In my code I have the following to run a remote script.
ssh root@host.domain.com \"sh /home/user/backup_mysql.sh\"
For some reason it keeps
As @wes-floyd and @zpon wrote, add these parameters to SSH to bypass "Are you sure you want to continue connecting (yes/no)?"
-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
This is usually happens when the remote is down/unavailable; or the remote machine doesn't have ssh installed; or a firewall doesn't allow a connection to be established to the remote host.
ssh
returns 255 when an error occurred or 255 is returned by the remote script:
EXIT STATUS
ssh exits with the exit status of the remote command or
with 255 if an error occurred.
Usually you would an error message something similar to:
ssh: connect to host host.domain.com port 22: No route to host
Or
ssh: connect to host HOSTNAME port 22: Connection refused
Check-list:
What happens if you run the ssh command directly from the command line?
Are you able to ping
that machine?
Does the remote has ssh installed?
If installed, then is the ssh service running?