SSH Tunnel Cheat Sheet

Some common tunnel commands I never remember.

Tunnel local port to remote machine

ssh -L local_port:remote_address:remote_port -N user@remote.machine

For example, if you have a remote service at 8000, with the following command, you can access it locally at port 9000:

ssh -L 9000:127.0.0.1:8000 -N treadful@server