2 # Manual: http://wiki.etersoft.ru/Autosshd
4 #The main connection parameters:
5 #1. Set remote host address or corresponding ip:
6 SSHHOST=user@example.com
7 #REMOTE_KEY=~/.ssh/id_rsa.pub
9 #4. Correct remote ports if necessary:
10 LOCAL_PORT=22 # the port is listen by sshd
11 REMOTE_PORT=10210 # the port for ssh command on $HOST $ ssh -p $REMOTE_PORT $REMOTESSH_USER@127.0.0.1
12 AUTOSSH_PORT=11210 # the local port for monitoring purposes (port+1 will used too, see man autossh)
17 [ -n "$REMOTE_KEY" ] && REMOTE_KEY_OPT="-i ${REMOTE_KEY}"
19 SSH_OPTIONS="-N $REMOTE_KEY_OPT -R ${REMOTE_PORT}:localhost:${LOCAL_PORT} ${SSHHOST} -o StrictHostKeychecking=no ${SSH_OPTIONS}"
20 AUTOSSH_OPTIONS="-M ${AUTOSSH_PORT} -f ${SSH_OPTIONS}"