1

I want to backup files from a server to my local computer using rsync. I can only log-in to the server with an RSA ssh key.

I have stored the passphrase to the key in Seahorse Passwords and Keys, which means I can log-in to the server without having to enter the passphrase everytime. I can also execute an rsync command related to the server without entering the passphrase.

When the same rsync command is executed from a cron job, it fails, because it is looking for a DSA key (as shown in the logs) instead of the RSA key.

2
  • Have you tried forcing the old ssh protocol version? rsync -e 'ssh -1' Commented Apr 18, 2013 at 14:50
  • @Anthon,the server uses only 2. Commented Apr 18, 2013 at 14:54

1 Answer 1

2

When you run something from cron, it doesn't have your environment variables, so it doesn't know to ask seahorse for your key. You'd need to have your script check for it. I've not done this myself, but I believe the way to go about it would be to run seahorse-agent --variables and then source those into the script.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.