Professional Documents
Culture Documents
An Illustrated Guide Tutorial, How To On SSH Tunneling
An Illustrated Guide Tutorial, How To On SSH Tunneling
tunneling
There are two situations which typify the need for ssh tunneling to a computer which is
publicly accessible on the Internet. Let's call this publicly accessible computer
"remote.server.com":
Here's what the command looks like for #1 when typed on your personal, local computer:
ssh -N -L 22000:localhost:11000 remote.server.com
-N After you connect just hang there (you won't get a shell prompt)
-L 22000 The connection will originate on port 22000 of your personal, Local machine
localhost:11000 remote.server.com will make sure that the other end of the tunnel is
localhost, port 11000
Here's what the command looks like for #2 when typed on your personal, local computer:
ssh -N -R 22000:localhost:11000 remote.server.com
-N After you connect just hang there (you won't get a shell prompt)
-R 22000 The connection will originate on port 22000 of the Remote computer (in this
case, remote.server.com)
localhost:11000 your personal, local computer will make sure that the other end of the
tunnel is localhost, port 11000
BONUS USAGE!!!
You've read this far, so one more useful usage we'll pretend to use
ssh -N -L 22000:192.168.1.2:11000 remote.server.com
-N After you connect just hang there (you won't get a shell prompt)
-L 22000 The connection will originate on port 22000 of your personal, Local machine
192.168.1.2:11000 remote.server.com will make sure that the other end of the tunnel is
192.168.1.2, port 11000