Pageant keys not working in crontab

118 Views Asked by At

I understand the issue but not sure how to fix it :(

Problem Story: I've installed pageant in my windows10 and added ssh keys(keys generated through puttygen) into it. configured putty session in windows10 with agent forwarding to access the servers(linux) with out using typing/credentials.

whenever I open putty session to login to any server, putty talks to the pageant and load/used my credentials without my involvement to enter credentials,. keys deployed to all over servers when I do ssh form one server to another server the pageant works fine and able to access,no issue at all untill paegent inactive....I'm happy till this part

when i use ssh in cron auto job, it unable to calls the keys from linux to pageant(win10).

how to make this to run in linux(cron)

1

There are 1 best solutions below

2
Martin Prikryl On

Of course not, as the cron does not run in the context of your SSH session.

So it cannot talk to local Pageant.

Even if the cron knows what user did create the job, how could it know, which of potentially many SSH sessions, you have opened, it should query for the keys? And what, if you actually do not have any SSH session open? The cron job should work even, when you are not connected to the server.


You have to have the keys stored on the server, where cron runs. There's no other way around that.