Auto ssh - MetiumIoT/Metium GitHub Wiki

Auto ssh

Na RPI należy zainstalować auto ssh

sudo apt-get install autossh ssh

Odinstalowanie:

sudo apt-get remove autossh ssh

SSH-KEY

ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

Enter passphrase (empty for no passphrase): *leave empty*

Enter same passphrase again: *leave empty*

Enable the tunnel on boot

sudo nano /etc/rc.local autossh -M 10984 -N -f -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -i /root/.ssh/nopwd -R 6666:localhost:22 remy@middleman -p 2222 &

ovh3

https://raymii.org/s/tutorials/Autossh_persistent_tunnels.html

Automatyczne wprowadzanie hasła ssh

apt-get install sshpass

sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400

Stack overflow https://stackoverflow.com/questions/12202587/automatically-enter-ssh-password-with-script