in reply to Re^7: Perl script in cron
in thread Perl script in cron

OK ... I kicked on debugging and it seems to be a problem with the key passphrase in batchmode:
nw05: Trying empty user-authentication request. nw05: Authentication methods that can continue: publickey,keyboard-int +eractive. nw05: Next method to try is publickey. nw05: Trying pubkey authentication with key file '/root/.ssh/id_rsa.pu +b' nw05: Will not query passphrase for '/root/.ssh/id_rsa.pub' in batch m +ode. nw05: Loading private key failed. Permission denied at /root/bin/getsysinfo.pl line 43

Gonna take a closer look on this.

/Roger

Replies are listed 'Best First'.
Re^9: Perl script in cron
by jettero (Monsignor) on Dec 19, 2006 at 14:14 UTC

    If I didn't know better, I'd say ssh is detecting the lack of a terminal and assuming it's in batch mode. I thought Net::SSH was native perl, but now I wonder if it has forked a /bin/ssh? ssh will definitely drop into "batch mode" from chron unless it's told not to do so, and afaik it won't accept passwords when it considers itself to be non-interactive.

    Perhaps you should set up a keypair?

    Update: duh. The native perl ssh has a different name: Net::SSH::Perl

    -Paul

      Well, Im out of idea's here I guess. Do I have to revert to feeding it with password (automaticly) perhaps :-(