Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] cron job to connect to a remote host with ssh key and a passphrase ?



Dear TLUG users,

I have a remote host whose file I would like to backup automatically
and (if possible) securely. Since the remote host doesn't have rsync
and there are only few files, what I did is set up a cron job on the
remote host to make a backup.tar.gz archive every day, and I would
like to set up a cron job on my host to fetch that backup every day.

Since I have ssh access, my idea was to use SCP and to log in
automatically using a SSH key (created only for that purpose). But I
don't want my SSH key to have no passphrase.

So what I did was use the ssh agent when my gnome session starts:

ssh-add /path/to/the/ssh/key

and then a window pops up to ask me for my passphrase and the agent
now should have the key. I confirmed this by manually doing the scp,
and indeed it fetches the file from the remote host without asking me
for password or passphrase.

But when it is the cron job, I get the following error message in my logs:

Permission denied (publickey,keyboard-interactive).

Is there any way so that the cron job has access to the ssh key ?

Evan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links