Autossh monitors a ssh connection and reconnects the ssh-session if the connection fails.
To automatically log in you need to use an authentication key.
The package, slightly outdated, can be found in the 'oldpackages' feed.
sshtunnel is a simpler, functionally-identical package. (depends on OpenSSH so higher disk space requirements)
opkg install autossh
dropbearkey -t rsa -f /etc/dropbear/id_rsa
dropbearkey -t rsa -f /root/.ssh/id_dropbear
dropbearkeywill print the public key, starting with
dropbearkey -y -f /etc/dropbear/id_rsa
dropbearkey -y -f /etc/dropbear/id_rsa | grep ssh-rsa > /tmp/pubkey
authorized_keysfile on your server, e.g. copy pubkey file to the server and do
cat pubkey >> ~/.ssh/authorized_keys
Autossh is configured using the Unified Configuration Interface (
To get ssh working you need to replace
2222:localhost:22 of the
ssh variable to the local ip.