Hi all. Long time listener, first-time caller.

I'm in the process of converting a script from using Net::SSH to Net::SSH::Perl. The module works fine, except for the fact that I can't get it notice that I have RSA public key-based authentication running. When I try to log into my machine via the scrupt, it just returns "Permission denied at ./test.pl line 10".

I know that the public key stuff is working: I can do it on the command line, and I can do it through Net::SSH. I imagine I need to set the %params or options properly, but the documentation for this aspect is sorely lacking. I've tried looking through
usenet, but the pickings are slim. I've played around with different values for the 'identity_files' option, as below.



Here's the code...



#!/usr/bin/perl


use Net::SSH::Perl;

$host = 'host';
$user = 'user';
$cmd = 'uname -a';

my $ssh = Net::SSH::Perl->new($host, debug => 1, identity_files => ["~/.ssh2/hostkeys/key_22_domains.pub"]);
$ssh->login($user);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);


print $stdout;




Thanks!


Chris Braiotta
Web Services Manager
Network Operations Center
Harvard University

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to