Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Weird error with SSH2 authentication

by ladyscifi (Novice)
on Oct 10, 2012 at 22:27 UTC ( #998331=perlquestion: print w/replies, xml ) Need Help??
ladyscifi has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to run this simple script:
use Net::SSH2; my $server = ""; my $ssh2 = Net::SSH2->new; die "can't connect" unless $ssh2->connect($server); print "Connected\n"; die "can't authenticate" unless $ssh2->auth(username => 'un', password => 'pw'); print "Authenticated\n"; $ssh2->disconnect();

and getting this error:

Connected Net::SSH2::auth_password: callback must be CODE ref at C:/Perl/site/li +b/Net/ line 295.

I've verified the username and password as well as the server ip address. The error makes no sense to me. Could any of you wise Perl Monks enlighten me?

Thanks, Nicole

Replies are listed 'Best First'.
Re: Weird error with SSH2 authentication
by choroba (Bishop) on Oct 10, 2012 at 23:40 UTC
    Read again the documentation for the auth method. If you are using password authentication exclusively, you can replace it with
    $ssh2->auth_password('un', 'pw');
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://998331]
Approved by kcott
[marto]: Corion, yeah, why no new browser window opens is currently beyond my understanding
[marto]: thanks
[Corion]: marto: Maybe it opens offscreen? I wouldn't know an easy way to confirm that, except maybe closing the chromeless window and then looking whether iexplore.exe is still running

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2018-03-21 11:55 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (267 votes). Check out past polls.