in reply to Error in Login by useing Net::OpenSSH

The module documentation contains a troubleshooting chapter. Follow it, specially point 3.

If after that, it still fails to connect, try this:

Enable the module debugging: $Net::OpenSSH::debug = -1;

Enable verbosity on the ssh command adding the following option on the constructor call:

my $ssh= Net::OpenSSH->new(..., master_opts => '-vvv');

and then, post here the output you get.