I have a Raspberry which establish a connection to a remote machine, via ssh, using a SSH Keypair, which allow it to access without prompting a password.
My question is this:
How I can do to establish a SSH-connection from the Raspberry to a default remote machine, which has a static IP, and execute a remote command, on Raspberry's boot? I've tried a lot of solutions, but none of these works!!
1) adding my script to /etc/init.d and then update-rc.d myscript defaults
2) adding into /etc/rc.local file
3) adding into /home/pi/.bashrc file
-----TO EXPLOIT THE AUTOMATIC CONNECTION OF PI TO WIFI_____
4) adding into /etc/network/if-up.d
5) adding by "post-up" command into interfaces file
I have ever fail. This below is my script:
#! /bin/sh ssh remotemachine@ip-address touch success