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?
Asked
Active
Viewed 531 times
2
-
1Are they behind _the same_ NAT? – u1686_grawity Oct 01 '19 at 10:30
-
No. They are behind different NATs – vedant lodha Oct 01 '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 01 '19 at 11:18
-
Its college wifi so cant forward port – vedant lodha Oct 01 '19 at 11:49
-
If it is college wifi, it might also be that SSH connections are firewalled as well. – Randomhero Oct 01 '19 at 14:23
-
Possible solution: [SSH connection between two behind-nat computers through third public-ip computer](https://superuser.com/questions/315523/ssh-connection-between-two-behind-nat-computers-through-third-public-ip-computer) – Flux Sep 10 '21 at 06:03
1 Answers
2
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
leiflundberg
- 121
- 3