Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Net::SSH::Perl Login

by sunadmn (Curate)
on Oct 07, 2003 at 17:20 UTC ( #297339=note: print w/replies, xml ) Need Help??

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/ line 36.
    Some more help would be appreciated as I dont seem to be able to get round this :-/


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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2020-07-06 21:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found