title: NET::SFTP:Foreign Unable to connect to the remote server
body: <p>When perl script initiate a sftp connection via <code>NET::SFTP:Foreign</code> module to the remote server it fails with the below error log message.  I tried <code>sftp</code> unix command from command prompt  to the same remote server it logs in successfully.  Not sure why perl code is failing. OS Solaris5.10 i86 architecture.</p>
  
  <pre><code>Permission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).
  unable to connect to remote host iblpdb.it.com.au: SSH slave exited unexpectedly with error code 255 
  </code></pre>
  
  <p>If fails at the below line of code</p>
  
  <pre><code>my  $sftp = Net::SFTP::Foreign-&gt;new("$sftpServer",
                                       user=&gt;$sftpUsername,
                                       password=&gt;$sftpPassword,
                                       asks_for_username_at_login=&gt;1,
                                       port=&gt;'22');
   $sftp-&gt;die_on_error("unable to connect to remote host $sftpServer");
  </code></pre>
  
  <p>If SFTP unix manual command is working with the same login and paasword  then  the perl script also should work.  Not sure what this error denotes.</p>