Net::SSH uses publickey for method of authentication and it executes
regular ssh. You should provide a publickey authentication mechanism to it. Then,you can use passwordless session.
If you need generate key within script,have a lookCrypt::DSA
and
RSA version Crypt::RSA::Key
Moreover,Why not using Net::SSH::Perl ?
Comment on Re: ssh key ( known_hosts ) through perl module