Mac – Unable to scp from remote to local Mac

macscpsshterminal

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?

Best Answer

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/
Related Question