in reply to Problem in sftp connection
In any case, Net::SFTP::Foreign got support for password authentication six years ago. Maybe it is time to upgrade your code to use it!