sshjump/host/start.sh

11 lines
321 B
Bash
Raw Normal View History

2018-06-05 15:33:21 -04:00
#!/bin/bash
2018-06-05 17:14:12 -04:00
servername=site.site.com
2018-06-06 06:51:41 -04:00
username=sshjump
2018-06-05 17:14:12 -04:00
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