title: Net::SFTP perl rsa authentification
body: <p>I've been trying to sftp with the package Net::SFTP and an RSA key. I can manually sftp without password to my sftp server but when using the package it doesn't work. I'm running out of idea.</p>
  
  <pre><code>my $ftp = Net::SFTP-&gt;new($HOST, user =&gt; $USER, ssh_args =&gt; { identity_files =&gt; [ "/Users/user/.ssh/id_rsa" ] }, debug =&gt; 3 );
  </code></pre>
  
  <p>It gives me the following error:</p>
  
  <blockquote>
    <p>Trying pubkey authentication with key file '/Users/tom/.ssh/id_rsa'</p>
    
    <p>FATAL: rsa import failed: Invalid input packet. at
    /Library/Perl/5.18//Crypt/PK/RSA.pm line 123.</p>
  </blockquote>
  
  <p>Any help would be much appreciated,
  Thanks!</p>