CmdID

CmdID / Commands

autossh

Run, monitor, and restart SSH connections. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Run, monitor, and restart SSH connections. Auto-reconnects to keep port forwarding tunnels up. Accepts all SSH flags.

Start an SSH session, restarting when the Monitoring port fails to return data

autossh -M monitor_port "ssh_command"Identify

Forward a Local port to a remote one, restarting when necessary

autossh -M monitor_port -L local_port:localhost:remote_port user@hostIdentify

Fork autossh into the background before executing SSH and do Not open a remote shell

autossh -f -M monitor_port -N "ssh_command"Identify

Run in the background, with no monitoring port, and instead send SSH keep-alive packets every 10 seconds to detect failure

autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" "ssh_command"Identify

Run in the background, with no monitoring port and no remote shell, exiting if the port forward fails

autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -o ExitOnForwardFailure=yes -L local_port:localhost:remote_port user@hostIdentify

Run in the background, logging autossh debug output and SSH verbose output to files

AUTOSSH_DEBUG=1 AUTOSSH_LOGFILE=path/to/autossh_log_file.log autossh -f -M monitor_port -v -E path/to/ssh_log_file.log ssh_commandIdentify