2018-06-05 15:33:21 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-06-05 17:14:12 -04:00
|
|
|
servername=site.site.com
|
|
|
|
username=root
|
|
|
|
serverport=22
|
2018-06-05 16:27:55 -04:00
|
|
|
dir=/opt/sshjump
|
|
|
|
remoteport=$(sqlite3 $dir/sshjump.db 'select port from sshjump')
|
2018-06-05 17:14:12 -04:00
|
|
|
localport=22
|
2018-06-05 15:33:21 -04:00
|
|
|
|
2018-06-05 17:14:12 -04:00
|
|
|
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R $remoteport:localhost:$localport $username@$servername -p $serverport -i $dir/id_rsa
|