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.
opkg install autossh
Create a key
dropbearkey -t rsa -f /etc/dropbear/id_rsa
dropbearkey will print the public key, starting with
ssh-rsa. You can reprint the key using
dropbearkey -y -f /etc/dropbear/id_rsaor write it to a file (e.g.
dropbearkey -y -f /etc/dropbear/id_rsa | grep ssh-rsa > /tmp/pubkey
Add the key to the
authorized_keys file on your server.
E.g. Copy pubkey file to the server an 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.