Having a problem w/ Net::SSH::Perl. I want it to run as close as possible to me running it on the terminal. In other words, try a simple login w/ the rsa keys.
The problem is actually 2-fold I believe.
my @id_files = qw(/home/me/.ssh/id_rsa.pub);
my $ssh = Net::SSH::Perl->new( 'host', debug => 1, protocol => 2, iden
+tity_files => \@id_files );
$ssh->login()
my ( $o, $e, $ex ) = $ssh->cmd( 'uptime' );
the main problem i get is this output.
host: Trying empty user-authentication request.
host: Authentication methods that can continue: publickey,keyboard-int
+eractive.
host: Next method to try is publickey.
host: Trying pubkey authentication with key file '/home/me/.ssh/id_rsa
+.pub'
host: Will not query passphrase for '/home/me/.ssh/id_rsa.pub' in batc
+h mode.
Loading private key failed.
I can assure you that the id_rsa.pub file is there. If I don't load @id_files implicitly, it seems to default to dsa keys, which will fail for almost all the machines I'm trying to talk to.
The other problem is there seems to be a lot of excess fluff going on that takes up time. "computing shared secret key", etc. Takes several seconds. I'll only be doing about 30 or so machines in off hours, but it would still be nice for it to work "quickly".
I could just as easily use the system call to ssh, but it would probably get tricky when I get to a machine w/ a bad key... the input would be stuck on the password prompt. Don't want to deal w/ forking and whatnot with this.
Cheers
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.