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

It has to do with the fact you are using the root account with Net::SSH::Perl. You have to specify an additional switch to get it to work.

I don't remember specifically what I had to do to get to work, but looking in the documentation for Net::SSH::Perl you have to set a switch to work with a privileged port if you are root.

If you don't get an answer here, you can always go to this mailing list. That was where I got my answer dealing with this module.

Replies are listed 'Best First'.
Re^6: Perl script in cron
by bashi (Acolyte) on Dec 19, 2006 at 13:18 UTC
    I tried the prvileged port thing, but nothing changed. When reading the docs for Net::SSH::Perl it seems to only make sence when using rhost and seems to default to true when root is detected as user.

      As I recall the switch that I used was not in the documentation. :( I cannot help you because the code I wrote was at a previous job and I no longer have access to it. :(

      If you don't get your answer here do try the mailing list. Someone will respond to your request. Good luck.

        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