SSHing to a machine behind NAT has generally been a daunting task. One of the common way that people tend to use is through forwarding a port from router on to the machine. But it is not always the case that a person has access to router configuration settings of his network. I recently stumbled upon an awesome tool named ngrok which solves this problem very elegantly. Even though this tool’s mail purpose is to take your localhost online but it has many other features out of which we will leverage one now. Let do it:
<br /> unzip ngrok.zip<br />
<br /> ./ngrok -proto=tcp 22<br />
Running the above command will take you to a screen like below –
In the above screenshot we can see that port 58339 on ngrok.com is forwarded to port 22 of our Linux/Mac machine.
ssh -p <nrgok_port> <local_machine_username>@ngrok.com
Like in the case of screen shot above I need to type in the following command –
ssh -p 58339 firstname.lastname@example.org
Enjoy SSHing fellas !!