Solved OpenSSH installed, but cannot use SCP
-
So I'm working up a template for my new XS install, and I need to copy a file over to it. I can ssh to it without any problem. Unfortunately when I attempt to scp the file over it prompts for authentication and then says "command not found". On the remote box I checked and the newest version of OpenSSH-Server is installed.
Any thoughts?
P.S. At this point I'm less interested in work arounds because I want to learn to work with scp by solving this issue, not simply get the file to the remote server (although that is a goal).
-
Okay, SCP definitely exists on CentOS 6.7 so....
Let's start with figuring out what the default shell is.
What is the output of...
grep USERNAME /etc/passwd
Where USERNAME is the username of the account that you are using for the SCP connection. This is on the server side.
-
@scottalanmiller said:
Okay, SCP definitely exists on CentOS 6.7 so....
Let's start with figuring out what the default shell is.
What is the output of...
grep USERNAME /etc/passwd
Where USERNAME is the username of the account that you are using for the SCP connection. This is on the server side.
operator11:0:operator:/<username>:/sbin/nologin
-
@Kelly said:
operator11:0:operator:/<username>:/sbin/nologin
That's the issue. No shell from which to run SCP.
-
SCP is part of SSH. To use it the account needs to login. Same as SFTP. You can't restrict an SSH account in this way. Nogin blocks SSH completely.
-
@scottalanmiller said:
SCP is part of SSH. To use it the account needs to login. Same as SFTP. You can't restrict an SSH account in this way. Nogin blocks SSH completely.
So what do I need to do to fix it?
-
Where you have /sbin/nologin you need to have /bin/bash instead.
-
@scottalanmiller said:
Where you have /sbin/nologin you need to have /bin/bash instead.
Ok, I edited /etc/passwd to change /sbin/nologin to /bin/bash. No change. When I'm logged in as root and just type scp I'm still getting command not found.
-
Okay, now THAT is weird. The weirdest part was that I was able to predict that you had nologin in the /etc/passwd file and that turned out to be true, but not the issue!!!
-
With root, what does this return:
which scp
-
Wait, you checked on OpenSSH... client or server? What OpenSSH packages do you actually have there. List them all...
rpm -qa | grep ssh
-
@scottalanmiller said:
With root, what does this return:
which scp
/usr/bin/which: no scp in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
(how do you use code blocks?)
openssh-5.3p1-112.el6_7.x86_64
openssh-server-5.3p1-112.el6_7.x86_64
libssh2-1.4.2-1.el6_6.1.x86_64 -
Code blocks is just for spaces at the beginning of a line.
-
Okay, OpenSSH is missing files.
yum reinstall openssh
-
No joy. I'm still getting the same output when I run just scp or which scp.
-
What is the history on this remote server? What was installed, what modified since it was put in?
-
@scottalanmiller said:
Code blocks is just for spaces at the beginning of a line.
That is a shortcut for single line.
A full block is three backticks on a line by itself, then the code, then three backticks on a line by itself to close it.
-
@JaredBusch said:
@scottalanmiller said:
Code blocks is just for spaces at the beginning of a line.
That is a shortcut for single line.
A full block is three backticks on a line by itself, then the code, then three backticks on a line by itself to close it.
That's way handier than what I have been doing. I need to start doing that.
-
@Kelly said:
No joy. I'm still getting the same output when I run just scp or which scp.
On both servers or just one?
-
@scottalanmiller said:
What is the history on this remote server? What was installed, what modified since it was put in?
Brand new, clean install. The only thing I've done on it is run updates.