Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: get ssh key passphrase from agent

by ninto1 (Novice)
on Aug 31, 2022 at 06:42 UTC ( [id://11146534]=note: print w/replies, xml ) Need Help??


in reply to Re: get ssh key passphrase from agent
in thread get ssh key passphrase from agent

I looked into it, and it seems to be just what I need!

Imma just try to implement it, and I will let you know, once I definately know if it works

Thank you a lot

  • Comment on Re^2: get ssh key passphrase from agent

Replies are listed 'Best First'.
Re^3: get ssh key passphrase from agent
by ninto1 (Novice) on Aug 31, 2022 at 07:25 UTC

    I tried to make a sample, which test everything I need from the module, but sadly I get an error, which I can't explain:

    failed connecting agent (-42 LIBSSH2_ERROR_AGENT_PROTOCOL) at .\sshtest.pl line 7.

    I think it should work, because the agent works just fine in CMD.

    I would appreciate any help!

      Crossposted to StackOverflow.

      It's considered polite to inform about crossposting, so that people not attending both sites don't waste their efforts hacking a problem already solved at the other end of the internets.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

        Oh, sorry. I didn't know that. I was never in this situation before, since my problems were easily solvable by just searching it on google.

      Can you post your example code which fails for you, so we can try to replicate your situation?

        Thank you for helping. Sure:

        #!/usr/bin/perl -w use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect('158.226.63.99') or $ssh2->die_with_error; $ssh2->auth_agent('z004kapc') or $ssh2->die_with_error; my $chan = $ssh2->channel() or $ssh2->die_with_error; $chan->exec('pwd') or $ssh2->die_with_error; print while <$chan>;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11146534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-18 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found