in reply to Re: Net::SSH::Perl Login
in thread Net::SSH::Perl Login

Thanks for the replies so far. To answer the questions thrown up so far.

sunadmn - The identity files are exactly what you say. The files used in RSA/DSA authentication

naChoZ - I am using the module documentation as my help, its about all I can find on this :-)

idsfa - Normally when I use these keys to log into the machines (manually) I am not asked for a pass phrase.

I have been having another look today and this is what I have so far.
$identity = "id_dsa"; $host = "target"; $usr = "user"; my %args; $args{identity_files} = $identity; $ssh = Net::SSH::Perl->new($host, %args); $ssh->login($usr);
When I run this I get the following errors which I dont really understand.
Can't use string ("id_dsa") as an ARRAY ref while "strict refs" in use + at /usr/lib/perl5/site_perl/5.6.1/Net/SSH/Perl/Auth/RSA.pm line 36.
Some more help would be appreciated as I dont seem to be able to get round this :-/

Replies are listed 'Best First'.
Re: Re: Re: Net::SSH::Perl Login
by zengargoyle (Deacon) on Oct 08, 2003 at 08:15 UTC

    try...

    $args{identity_files} = [ $identity ]; # takes ARRAY $args{protocol} = '2,1'; # try v2 first

    works for me...

    use Net::SSH::Perl; $ssh = Net::SSH::Perl->new( "rtrfoo", { identity_files => ["$ENV{HOME}/.ssh/id_dsa"], protocol => "2" } +); $ssh->login("myself"); print "@{[$ssh->cmd(q(show version))]}" __END__ Hostname: rtrfoo Model: m20 JUNOS Base OS boot [5.6R2.4] JUNOS Base OS Software Suite [5.6R2.4] ...