Skip to content

Instantly share code, notes, and snippets.

@kleo
Forked from thomasfr/autossh.service
Last active June 24, 2019 13:59
Show Gist options
  • Save kleo/154d531ae5f5cb2766be3d8a15626342 to your computer and use it in GitHub Desktop.
Save kleo/154d531ae5f5cb2766be3d8a15626342 to your computer and use it in GitHub Desktop.
serveo.net systemd service for autossh
# serveo.net systemd service for autossh
# Modify username to your username
# Connect to ssh server
# ssh -J serveo.net username@alias
[Unit]
Description=autossh service
After=network.target
[Service]
User=username
ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -p 22 -l username -R alias:22:localhost:22 serveo.net
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment