This question already has an answer here:
I have a remote machine, with which I have set up public-key ssh auth - that is, I can ssh to it without typing in password each time. And I have a set of actions in a script, which use that ssh connection.
But when I run that script via cron, it keeps asking passphrase for each action - and since I have more that ten of them, it gets quite boring.
I tried running ssh-add before those actions and got:
Could not open a connection to your authentication agent.
What can I do to reduce number of passphrase retypes?