Skip to content

Instantly share code, notes, and snippets.

@mashcom
Created February 3, 2023 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mashcom/5612d9d67b0e5098082dda856a9edf2b to your computer and use it in GitHub Desktop.
Save mashcom/5612d9d67b0e5098082dda856a9edf2b to your computer and use it in GitHub Desktop.
Create SSH Tunnel
[Unit]
Description=AutoSSH tunnel service everythingcli MySQL on local port 5000
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -p 64371 -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NL 5000:localhost:3306 root@target_server
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment