3 - run ssh from the command line
Check you can connect to the remote host using the same parameters you are passing to Net::OpenSSH. In particular, ensure that you are running ssh as the same local user.
If you are running your script from a webserver, the user would probably be www, apache or something alike.
Common problems are:
Not having the remote host public key in the known_hosts file.