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?

link|improve this question
feedback

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

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

1 Answer

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.
link|improve this answer
feedback

Your Answer

 
or
required, but never shown