Last active
August 29, 2015 14:20
-
-
Save alexander-arce/a0f9a3503fe85655ac8f to your computer and use it in GitHub Desktop.
AutoSSH tunnel mysql
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
| cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys' | |
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
| # autossh startup Script | |
| description "autossh daemon startup" | |
| start on net-device-up IFACE=eth0 | |
| stop on runlevel [016] | |
| respawn | |
| respawn limit 5 60 # respawn max 5 times in 60 seconds | |
| script | |
| export AUTOSSH_PIDFILE=/var/run/autossh.pid | |
| export AUTOSSH_POLL=60 | |
| export AUTOSSH_FIRST_POLL=30 | |
| export AUTOSSH_GATETIME=0 | |
| export AUTOSSH_DEBUG=1 | |
| autossh -M 0 -q -f -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -p 2022 -L 3307:localhost:3306 xxx@xxxx.m.com | |
| end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment