I just coded a script using svnsync. Svnsync creates a connection to a remote host via ssh.
The authentification of the ssh-connection is realized via a certificate file. Alas everytime the script is executed it asks for the certificates password.
How can I set up my script, such as it can be run as cronjo开发者_运维知识库b. (does not ask for a pw) ?
I really don't want to type my password anywhere in plaintext. So encryption would be nice too.
You're probably looking for ssh-agent
. You decrypt your keys into the agent, and then all ssh-clients that have access to the environment variables it defines get free access to the keys within. Excellent tool.
I think you have 2 options:
- Use an SSH key (certificate) without a passphrase and protect it with filesystem permissions.
- Use an SSH agent. The problem with this approach is that you need to enter a passphrase at some point so using it with cron jobs is a bit trickier.
精彩评论