Return to Snippet

Revision: 6282
at May 14, 2008 03:59 by Juanje


Updated Code
# Reverse ssh tunnel:
# Host to access -> destination.host.net ; user=dest_user
# Source host    -> source.host.net      ; user=src_user
[email protected]$ ssh -R 22000:localhost:22 -f -N [email protected]
[email protected]$ ssh -p 22000 dest_user@localhost

Revision: 6281
at May 14, 2008 03:52 by Juanje


Initial Code
# Reverse ssh tunnel:
# Host to access -> destination.host.net ; user=dest_user
# Source host    -> source.host.net      ; user=src_user
[email protected]$ ssh -R 22000:localhost:22 -f -N [email protected]
[email protected]$ ssh -p 22000 dest_user@localhost

Initial URL

                                

Initial Description
This is very useful with dinamic IP connections. You can connect from the host with the dinamic IP, leave the tunnel open to other machine with ssh access and fixed IP and then connect to this machine on specific port (22000 in the example) to connect to the host with dinamic IP.

Also it can be useful in case you need access to a host which is inside a local network and you can't access from outside, but from this host you can connect to outside.

Initial Title
Reverse ssh tunnel

Initial Tags
ssh

Initial Language
Bash