Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have machine A with a public IP address (addr_a), machine B within a LAN of private IP address(addr_b), the router of the LAN has a public IP address (addr_r). If I log into machine A by ssh from machine B, how can I use the command scp to copy files from machine A to machine B?

share|improve this question

migrated from stackoverflow.com Sep 21 '11 at 19:47

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 0 down vote accepted

Can you avoid logging in there? It would probably be better to run scp from B like

scp addr_a:foo/bar/baz .

If you absolutely cannot avoid it, you can either

  • do a port forwarding from your router to addr_b,
  • setup IPv6 and give B an own address,
  • ssh from B to A with a remote port forwarding and then use this to get back.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.