kdamundson has asked for the wisdom of the Perl Monks concerning the following question:
I'm tring to automate our password changes via Net::SSH::Perl and Net::SSH::Perl::Auth
The script works fine with a hard coded login. However, when using:
my $ssh = Net::SSH::Perl->new($server, identity_files => "/root/.ssh/authorized_keys", protocol=>'2,1');
my $auth = Net::SSH::Perl::Auth->new('RSA', $ssh);
the command: my ($stdout, $stderr, $exit) = $ssh->cmd("$cmd"); fails to change the password, but appears to return with no error(after stepping thru with the debugger, the RSA authentication looks good but when printing out the variables, I get nothing back).
I tried passing the $auth ref: my ($stdout, $stderr, $exit) = $auth->cmd("$cmd"); but this errors out. Am I missing code here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH::Perl::Auth problem
by salva (Canon) on Mar 31, 2011 at 15:59 UTC | |
by kdamundson (Initiate) on Mar 31, 2011 at 16:37 UTC | |
by kdamundson (Initiate) on Mar 31, 2011 at 17:19 UTC | |
by salva (Canon) on Apr 01, 2011 at 09:43 UTC |