简体   繁体   中英

Pageant keys not working in crontab

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM