I have made a shell script(/bin/sh) that starts a perl script (that I haven't made my self) that's starts a ssh session. The ssh session uses a private/public key to login so no password is needed. The Perl script works perfect.
But when I put it in a cronjob (crontab) the ssh connection asks for password. This makes the scripts fail. Seems like ssh keys are not working while running in cron. Is there a process that I shall start?
This is the reason why I made the shell script to load most of my env variables( I know that cronjob starts with a slim shell) from my normal shell. I thought it was some env variable that I have missed to set. I don't have much Unix experience so not sure how I can describe the problem more. If there anything else that I have to say ask about it.
I tried to search for it but found something about ssh-agent. That should be started but didn't understand it. Also something about a keying.
I don't know about putting it in your path, but you could alias "ssh" to "ssh -i /whatever/path". For some reason I never got to the bottom of, ssh doesn't find my keys either on our system, so I added "alias ssh='ssh -i ~/.ssh/identity'" to my bash startup files.
Since you are using cron however, I think you may need to create a small wrapper containing just the alias + call to the perl script, and start *that* from within crontab. Or something like that