in reply to Net::SFTP permission denied but sftp works

Take a deeper look at what happens inside the login() method. Since the module should try to authenticate with a public key, my guess is that the key file is unreadable to the script.