in reply to Perl Net::SSH2 unable to connect
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Net::SSH2 unable to connect
by kabachaa (Novice) on Feb 26, 2013 at 21:44 UTC | |
|
Re^2: Perl Net::SSH2 unable to connect
by VinsWorldcom (Prior) on Feb 27, 2013 at 13:59 UTC |