Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
Have you tried forcing the old ssh protocol version? rsync -e 'ssh -1' –  Anthon Apr 18 '13 at 14:50
    
@Anthon,the server uses only 2. –  systemovich Apr 18 '13 at 14:54

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.