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

Thanks everyone. I discovered that perl wasn't reading the keys at all, due to the fact that the SSH config file is located under /opt/ssh/etc on unix (my machine) as opposed to the expected /etc... directory that Net::SFTP looks for. I simply copied the /opt/ssh/etc/ssh_config file to ~/.ssh and uncommented the IdentityFile line with ~/.ssh/id_rsa and all works!

Replies are listed 'Best First'.
Re^2: Net::SFTP permission denied but sftp works
by Anonymous Monk on Apr 09, 2024 at 12:06 UTC
    Could you please paste your modified code which is working here? even I am facing the same issue