3 ms·
If you're running systemd you can use this: [Unit] Description=SSH remote forwarding to here After=network-online.target Requires=network-onlin
by emmelaich 11y ago
If you're running systemd you can use this:
[Unit]
Description=SSH remote forwarding to here
After=network-online.target
Requires=network-online.target
[Service]
User=autossh
ExecStart=/bin/ssh -N -o PasswordAuthentication=no -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 2222:localhost:22 -o TCPKeepAlive=yes -p 9196 -i /home/autossh/.ssh/autossh autossh@example.com
Restart=on-failure
RestartSec=1200
[Install]
WantedBy=multi-user.target