Ssh tunnels
- Written on: 2024-02-26
- Debian version used: 12
Local vs Remote
A local (-L) tunnel allows you to forward a port on the server to your local machine (ie to acces a service on the server from your local machine)
A remote (-R) tunnel allows you to forward a port on your client machine to the server (ie to forward a local dev server to a server)
Local tunnel
Remote tunnel
Autossh
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -L 5000:localhost:3306 user@server.be