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?

link|improve this question
feedback

1 Answer

The way the question is asked is pretty confusing, but if you can copy form 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/
link|improve this answer
Thanks, I'll give it a try and confirm if it worked for me. – user98496 Sep 20 '11 at 14:10
I think the question is more about setting up dyndns and port forwarding...he just didn't know what to ask. – aking1012 Sep 20 '11 at 14:22
True, I probably don't know what to ask. I'm still learning. If you could offer further explanation about what ports I need to forward (and any info I'll need regarding dyndns) in order to achieve my goal, I'd appreciate it:-) – user98496 Sep 20 '11 at 15:31
Suggestion in first response did not work. Normally, when I type: "scp -r somedir me@123.45.6.7:/home/me/Desktop" it works fine. However, If I try this from a public WIFI connection at say, Starbucks (and not at home), it doesn't work. What am I doing wrong? – user98496 Sep 20 '11 at 18:59
oh right. ok that's a different issue. You need to allow access to ssh from outside your network. This is done by forwarding a port on the your broadband router to the lan ip of your server. However there's some security concerns with allowing ssh access from outside, so you may also want to look into methods to secure ssh, particually key-based authentication and disable password authentication entirely. – Sirex Sep 21 '11 at 7:51
show 2 more comments
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.