Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Net::SFTP::Foreign and Using Passphrases on Private Keys

by mlebel (Hermit)
on Apr 27, 2012 at 13:53 UTC ( #967636=note: print w/ replies, xml ) Need Help??


in reply to Net::SFTP::Foreign and Using Passphrases on Private Keys

According to http://search.cpan.org/~rkitover/Net-SSH2-0.44/lib/Net/SSH2.pm#auth_publickey_%28_username,_public_key,_private_key_,_password__%29

It appears that passwords are supported for public keys.. "auth_publickey ( username, public key, private key , password ) Note that public key and private key are names of files containing the keys! Authenticate using keys and an optional password."

Also, i'm not sure if this is a typo but your "passphrase => $passphrase," should be "passphrase => $passPhrase,"

If I am reading the documentation correctly, "passphrase =>" should be "password =>"

I hope this helps


Comment on Re: Net::SFTP::Foreign and Using Passphrases on Private Keys
Re^2: Net::SFTP::Foreign and Using Passphrases on Private Keys
by swamprich (Novice) on Apr 27, 2012 at 14:12 UTC

    thanks for the quick response, but that Net-SSH2 package is different than the backend package I'm utilizing via Net::SFTP::Foreign. The package I'm using is here Net::SFTP::Foreign::Backend::Net_SSH2

    You're correct in that it was a typo, sorry about that. And if I was using the Net_SSH2 package, it would be $password instead of $passphrase. I've attempted to use the Net_SSH2 package before but it doesn't really work on Windows (getpwuid errors) and I need to make sure this code is cross platform.

      that Net-SSH2 package is different than the backend package I'm utilizing via Net::SFTP::Foreign

      No - Net-SSH2 is the backend package that Net::SFTP::Foreign::Backend::Net_SSH2 uses.

      but it doesn't really work on Windows (getpwuid errors)

      Actually, Net-SSH2 now works pretty well on Windows. That 'getpwuid' problem was fixed long ago.

      Cheers,
      Rob

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-08-21 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (141 votes), past polls