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