I would like to ssh into my friends computer which is behind a NAT from my computer which is behind a different NAT(college wifi). Is there any way this can be achieved?

  • Are they behind the same NAT? – user1686 Oct 1 '19 at 10:30
  • No. They are behind different NATs – vedant lodha Oct 1 '19 at 10:52
  • If the friend's PC is behind a router they or you have access to, simply forward an arbitrary port to the friend's PC the SSH server is running on (i.e. WAN port 56150 to LAN port 22 at IP X [friend's PC's LAN IP]). It would be ideal for DDNS to be setup on the Friend's router, however DDNS can be configured on the Friend's PC via software from Dyn (for example). DDNS is required if the ISP is not providing a static WAN IP. – JW0914 Oct 1 '19 at 11:18
  • Its college wifi so cant forward port – vedant lodha Oct 1 '19 at 11:49
  • If it is college wifi, it might also be that SSH connections are firewalled as well. – Randomhero Oct 1 '19 at 14:23

You need a public facing port to connect to. A good solution is NGROK , search "TCP tunnel". It exposes the port to its own temporary domain name that is public facing.

Here is a link to their documentation: https://ngrok.com/docs

Hope this helps, best regards

| improve this answer | |

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.