I have 3 computers running ssh server on them:

  • PC1 is running Cygwin on Windows
  • PC2 is also running Cygwin on Windows
  • PC3 is running Linux

and they are on the same network connected to same router.

I can connect to all 3 of these locally. Funny thing is I can't connect to PC2 and PC3 remotely (but I can access PC1 remotely). I forwarded the ports of PC1, PC2 and PC3 in same way and used a custom port.

This is the same error message I get when trying to connect to PC2 and PC3 remotely:

$ ssh -l username username@externalIP -vvv
Reading configuration data /etc/ssh_config
ssh_connect: needpriv 0
Connecting to externalIP [externalIP] port X.
connect to address externalIP port X: Connection timed out
ssh: connect to host externalIP port X: Connection timed out

I can access PC2 remotely using remote desktop

  • 1
    I may have this wrong but a possible explanation that springs to mind is the port forwarding on your NAT router forwards to the IPs of the computers you find you are able to reach remotely, but doesn't forward to the others. You could run SSH on different ports and do port forwarding on your router separately for each computer. – barlop Feb 10 '14 at 21:35
  • Yes that fixed it! I used different ssh ports for both computers and it works now. Thanks. Any idea why the router did forward to these pcs? – user299028 Feb 10 '14 at 22:01
  • 1
    It's not clear from your writeup, but the key would be you would need different external ports for each system. So port 2201 could go to port 22 of PC1, 2202 to PC2, etc. – ernie Feb 10 '14 at 22:10
  • Typing mistaking, I meant to say why the router didnt forward these ports – user299028 Feb 11 '14 at 7:18

Edit: The solution I was told above, was to change the port number of both PC2 and PC3. This is so that they dont use the same ssh port as each other and it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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