ssh tunnel to get into a private network

If Your Linux box is inside a private network and You need some friend of yours get in, ssh may help You: from the linux box try

ssh -R afreeport:localhost:22 user@remote.host.name

E.g. the command

ssh -R 2048:localhost:22 jose@nic-nac-project.de

opens a shell on the nic-nac-project.de host redirecting all connections to port 22 (ssh) to the 2048 port.
It means while your ssh session is opened, all the users logged into nic-nac-project.de host can get inside your Linux box opening a ssh session to 2048 port of localhost.

ssh -p 2048 localhost

Obviously ssh server daemon have to be running on the linux box!

Tags:

Leave a Reply