http://qs321.pair.com?node_id=297339


in reply to Net::SSH::Perl Login

Can you give me a little better understanding of what you mean by "identity files"?? Are you talking about using the keys which auto auth a user into the box??

Replies are listed 'Best First'.
Re: Re: Net::SSH::Perl Login
by alongwor (Novice) on Oct 08, 2003 at 07:53 UTC
    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 :-/

      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] ...