The line:
if ($ssh2->auth_keyboard($user,$pass)) {
doesn't work for me either. I get the same error with correct credentials.
Try using your commented out auth_password() instead of auth_keyboard() and it worked for me:
VinsWorldcom@C:\Users\VinsWorldcom\tmp> grep auth_ test.pl #if ($ssh2->auth_password($user,$pass)) { if ($ssh2->auth_keyboard($user,$pass)) { VinsWorldcom@C:\Users\VinsWorldcom\tmp> perl test.pl ssh auth failed. Net::SSH2::DESTROY object 0x2398d78 VinsWorldcom@C:\Users\VinsWorldcom\tmp> grep auth_ test.pl if ($ssh2->auth_password($user,$pass)) { #if ($ssh2->auth_keyboard($user,$pass)) { VinsWorldcom@C:\Users\VinsWorldcom\tmp> test.pl Executing command... ==> Running ls Undefined subroutine &main::is_sshalive called at C:\Users\vincen_m\tm +p\test.pl line 18. Net::SSH2::DESTROY object 0x2398d78
Note: The error in the second output has to do with is_sshalive() not being a valid sub - not sure where you've defined that.
In reply to Re: Perl Net::SSH2 unable to connect
by VinsWorldcom
in thread Perl Net::SSH2 unable to connect
by kabachaa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |