Can't scp :( help

Having a really strange problem, cannot seem to SCP into my Mac Pro box. SSH is installed and working fine, however when I use the scp command remotely I get from the remote server after entering my password:

"bash: scp: command not found"

on the mac pro scp is in it's normal place , i.e. /usr/bin/scp ,

I can ssh in fine, just can't seem to get scp working right.

Thanks!

Mac Touch Pro, Mac OS X (10.5.3)

Posted on Jun 3, 2008 2:13 PM

Reply
11 replies

Jun 3, 2008 4:22 PM in response to rebotfc

I think deh2k is probably right. It sounds like as far as sshd is concerned, it can't find scp. You might want to check out the /etc/sshd_config file, at the top is a PATH string telling you what paths the daemon knows. Does that by chance not list the path that scp is installed at?

I would also run the simple test that deh2k mentioned. Does the shell/system find scp when you use an relative path invocation?

Jun 3, 2008 4:23 PM in response to V.K.

Yes, he writes that it does not work when using the scp command remotely.

I interpret this as doing something like

ssh user@remotebox 'scp somestuff tosomewhere:else'

I think default behaviour for remote command execution is in fact to reset the environment
to something restricted. This can further be restricted if a key is used for authorization.

specifying the full path should do the trick.

Jun 3, 2008 4:29 PM in response to V.K.

I'm unsure how to specify where to find scp on the remote host. Does it use a specific location, or the user's path? I suspect that it has nothing to do with the user's profile, so it would look in a specific place or places for it. If that's the case then why doesn't it run? Is there something wrong with it or can't it be found for some reason?

That's my thinking process anyway.

Jun 3, 2008 4:41 PM in response to deh2k

this was just an idea to try. I've just never seen scp failing because bash didn't recognize it and i thought that maybe something is wrong with the system PATH variable on the remote host where the command is being executed. I'm not exactly sure how the OP is using it as he was somewhat unclear about it.

Jun 3, 2008 7:13 PM in response to deh2k

If you move /usr/bin/scp to something like /usr/bin/scp.O on the remote host, then try a typical scp copy from the source machine:

user% scp myfile remote user@remotehost:/some/directory

then you will see the exact error that the original poster sees. I think it's sshd on the remote machine that knows about PATH, and that is what ultimately allows it to "find" scp.

So it may be that either scp really isn't in /usr/bin/, or sshd on the remote machine doesn't have the correct PATH specified.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can't scp :( help

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.