Hello monks. This is my first post.
I am having some problems with Net::SSH::Perl and I was hoping maybe some of you could help.
I am trying to make a script work with RSA keys. Here is a an example of the test code I have tried so far.
use strict;
use Net::SSH::Perl;
my @key = ('identity_files', '/usr/home/username/.ssh/identity');
my $ssh = Net::SSH::Perl->new("host", @key);
my $auth = Net::SSH::Perl::Auth->new('RSA', $ssh);
print "Valid auth" if $auth->authenticate;
my ($out, $err, $exit) = $ssh->cmd("uname -a");
print "$out\n";
I am getting an error message that says...
Can't use string ("/usr/home/username/.ssh/identit") as an ARRAY ref while "strict refs" in use at /usr/local/lib/perl5/site_perl/5.005/Net/SSH/Perl/Auth/RSA.pm line 36, <GEN0> chunk 1.
I have gone through the documentation several times trying to figure out what I am doing wrong, but I guess I am just not getting it. Can anyone show me where I am going wrong here?
Also is there anyway to get the RSA keys to work with keys that have a pass phrase on them? Thanks for the help.
Rick
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.