Benches macOS

11

Can't scp :( help

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

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!

11 replies

Sign in or join Beachball Help to reply.

  1. 0

    deh2k

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Have you ascertained whether or not scp is actually working on the Mac Pro? If you log in there and just type scp do you at least get some usage text?

  2. 0

    V.K.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    could be something wrong with your PATH, maybe?

    try using the full path

    /usr/bin/scp

  3. 0

    glsmith

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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?

  4. 0

    spoxta

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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.

  5. 0

    deh2k

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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.

  6. 0

    V.K.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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.

  7. 0

    glsmith

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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.

  8. 0

    rebotfc

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Many thanks to everyone for their suggestions, indeed scp is installed and working fine on the Mac Pro. It is in /usr/bin/scp.

    I am trying a command like : scp test user@mac-pro-ip-address:.

    I think it is something to do with sshd not knowing the correct path, just have to figure out how it know's its path.

  9. 0

    V.K.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    have you tried it using the full path for scp? that's the only suggestion we came up with here.

    */usr/bin/scp test user@mac-pro-ip-address:.*

  10. 0

    rebotfc

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Just wanted to say I figured it out, my .bashrc file was corrupted i guess preventing sshd from getting the path.

    Thanks everyone for their help.

  11. 0

    deh2k

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks for the update, and I'm glad you got it working. I didn't know that sshd used your path to locate scp for the server side.