2

Unfortunately, my web hosting plan does not allow public key authentication. Apparently, this method is available to VPS and dedicated server customers only.

I've backed up my Ubuntu 11.10 machine using Deja-Dup and I'm sending the backed up files to my web host using rsync.

I would like to automate this process using a script, but as I am not able to use public key authentication, I am forced to manually copy and paste my (strong) SSH password each time to start the process.

Is there a way round this? If so, how?

1 Answers1

1

If you need to enter your password, you'll have to do it through expect, because ssh insists on passwords coming from a terminal. Here's an example expect script.

It's possible that the host has disabled public key authentication, but that would require that they deliberately turn it off (with PubkeyAuthentication No in /etc/sshd/sshd_config). There's no technical reason why they'd do it, it would be purely for market segmentation.

I recommend that you first try to make public key authentication work. Follow this procedure to generate and upload a key. Don't hesitate to ask here if something doesn't work; if you tell us what you tried and what error messages you got, we might be able to propose a workaround. If you run into problems, post the sshd configuration (/etc/sshd/sshd_config if the web host is running Ubuntu, maybe another location like /etc/sshd_config if the host is running some other distribution), and the output of ls -ld ~ ~/.ssh; ls -l ~/.ssh.