in reply to Connecting using Net-OpenSSH with public key instead of password

Hi NewMonk2Perl

The first thing I noticed is that you aren't calling new() the way the documentation shows. The host is either a string or a variable but not part of the hash. The options hash is the second parameter.

my $ssh = Net::OpenSSH->new($host, %opts); $ssh->error and die "Can't ssh to $host: " . $ssh->error

If fixing that doesn't solve your problems there is a debugging section at the end of Net::OpenSSH.

For instance, in order to activate all the debugging flags, you can use:
$Net::OpenSSH::debug = ~0;

Update:

Try changing just this one line in your program:

my $ssh = Net::OpenSSH->new( $host, user=>$user,