autossh -M 0 -N -o ServerAliveInterval=60 -R 8080:localhost:3000 user@tunnel.example.com

Category: Local Network & Public Hosting

autossh -M 0 -N -o ServerAliveInterval=60 -R 8080:localhost:3000 user@tunnel.example.com

Keep an SSH tunnel alive across drops

autossh supervises an ssh process and restarts it whenever the connection dies, turning a fragile reverse tunnel into a service. The -M 0 form disables autossh's own monitor port and relies on OpenSSH's ServerAliveInterval to detect dead links, which is the recommended modern setup. Run it under systemd for boot persistence.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.