I managed to login to my hosting provider manually with this command:
ssh -i /path/to/key-ssh me@mydomain.com
The server then asks for a password, and login succeeds.
Now I want to automate a MySQL backup, so I need to login using a shell script. (to be clear: my provider requires a keypair and a password both to login)
Then I tried to use sshpass:
sshpass -p 'MYPASSWORD' ssh me@mydomain.com
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Then I tried this:
sshpass -p 'MYPASSWORD' ssh -i /path/to/key-ssh me@mydomain.com
With this the remote server does not respond at all (prompt freezes)
My server runs Debian 8.10 (Jessie)
I am aware of the security risks using sshpass, but I am the only one using this server. I also tried automysqlbackup, but it gives my a headache trying to get it to work over ssl.
Automating a backup over SSH seemed the simplest solution (of which I'm no so sure anymore...)