Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Sep 21 '11 at 19:47

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

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


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