Unable to scp from remote to local Mac

I have gone over SU and SO posts looking for a way to get this to work, but I'm about to put up my hands and stick with a GUI. I want to scp a ZIP file from a remote server to my local machine. I can SSH in just fine. I can create, delete, edit, etc... but am unable to download a ZIP. The "closest" so far.

# scp backup.zip Steven@111.111.111.11:/Users/Steven/Desktop/test.

For clarity, "backup.zip" is what I want to pull down from the server and is in my current directory. "Steven" is my username on my laptop. I've blanked out the IP address for my local machine with the ones, and the path is the path to the location I would like to copy to.

With that, however, I get:

ssh: connect to host 111.111.111.11 port 22: Connection timed out lost connection

Funny thing is, I'm not booted out of the session. It just leaves me right where I was before entering in the command. Am I missing some syntax?

2 Answers

Do I understand correctly that you're using SSH to connect to the remote host, then you're running scp on the remote host to copy the file back to the local host?

Without knowing anything about these two hosts, it's perfectly possible that your local host can make SSH connections to the remote, but the remote can't make SSH connections to the local.

If you can make SSH connections from the local host to the remote host, you could run scp on the local host instead of the remote one:

scp remoteuser@remotehost:/path/to/backup.zip /Users/Steven/Desktop/test/

Are you sure your local Mac is reachable at that IP address, from the remote machine? For example, if you had an RFC 1918 private address such as 192.168.x.y on your local Mac because it was behind a NAT gateway, and the remote machine was on the public side of the NAT gateway, then the remote machine wouldn't be able to reach your local Mac at that address, because RFC 1918 private addresses aren't routable. You'd have to put a port mapping on your NAT gateway to map port 22 from its public address to port 22 on the Mac's private address, and then scp to the NAT gateway's public address.

Or do what @Kenster suggested and run the scp command the other way around, from the local machine.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like