How to SCP from remote machine to local machine when I am outside of the home network


While I understand how to scp files to and from my server from within my home network, how can I scp a file from my server to my local machine when I am on the outside, say at Starbucks?

While I am able to scp from my local machine to my server in this scenario, I haven't figured out how to grab a file from home, using the command line. Any suggestions?

Best Answer

The way the question is asked is pretty confusing, but if you can copy from your local machine to the server, to go the other way just flip the command line order.

its scp [from] [to]

scp user@homeip:/path/to/file /local/path/