Autosshd
Материал из Etersoft wiki
Пример использования
1) Create configuration file at /etc/autossh.d/example.com.conf.template
The main connection parameters: 1. Set remote host address or corresponding ip: HOST=example.com 2. Create user with OS tools and write down login here: REMOTESSH_USER=_autossh 3. Copy user private key file (id_dsa) from $HOST to anyssh/.ssh directory and check access rights: it must be 0600 REMOTE_KEY=/var/lib/autosshd/.ssh/id_dsa.$HOST.$REMOTESSH_USER Correct the remote ports if necessary: LOCAL_PORT=22 the port is listen by sshd REMOTE_PORT=10210 the port for ssh command on $HOST $ ssh -p $REMOTE_PORT $REMOTESSH_USER@127.0.0.1 AUTOSSH_PORT=11210 the local port for monitoring purposes (port+1 will used too, see man autossh) AUTOSTART=yes
Private ключ взял из скрипта etersoft_tunnel.sh и положил в /var/lib/autosshd/.ssh/id_dsa.anyssh.a185
2) Run the service
service autosshd start