How to Create a Reverse SSH Tunnel?

SSH reverse tunnel through commandline

ssh -fN -R 2222:localhost:22 [email protected]_of_remote_machine


So this ssh connection request originating from remote server to your machine will make sure that any ssh connection request for port 2222 on your machine is forwarded to port 22 of remote server.

Now do an ssh connection request from your machine to your own machine at port 2222:

ssh [email protected] -p 2222

 

Example:

Posted on: Saturday 01 October 2016