Created
May 7, 2022 21:14
-
-
Save vavrecan/798b25ec83ec5a3117fae857bedbca77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=AutoSSH tunnel service | |
After=network-online.target ssh.service | |
[Service] | |
User=root | |
Restart=always | |
ExecStart=/usr/bin/autossh -M 0 -q -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" admin@myip -R 2222:localhost:22 | |
ExecStop=/usr/bin/killall -9 autossh | |
[Install] | |
WantedBy=multi-user.target | |
# systemctl daemon-reload | |
# systemctl enable autossh-tunnel | |
# systemctl start autossh-tunnel | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment