title: Camel sftp - jsch auth fail
body: <p>Camel sftp publickey connection fails with the below auth fail error. 
  Created id_rsa and id_rsa.pub and known_hosts file in source system (Tried with both windows and linux). 
  Copy pasted the contents of id_rsa.pub in the target system authorized_keys file.</p>
  
  <p>Note: This is working fine with winscp, putty, and local jcraft sample code.
  This code was working fine couple of months back. Suspecting jar changes or version conflict in the application I checked but couldn't find anything.
  I ran out of options to try. Please help.</p>
  
  <p>Camel route address: </p>
  
  <blockquote>
    <p>sftp://user@192.168.1.1:22/messages/out?preferredAuthentications=publicKey&amp;privateKeyFile=C:/Users/user/.ssh/id_rsa&amp;privateKeyPassphrase=&amp;jschLoggingLevel=INFO</p>
  </blockquote>
  
  <p>Error and JSCH log:</p>
  
  <pre><code>org.apache.camel.component.file.remote.SftpOperations - Using private keyfile: C:/Users/user/.ssh/id_rsa
  org.apache.camel.component.file.remote.SftpOperations - Known host file not configured, using user known host file: C:\Users\user/.ssh/known_hosts
  org.apache.camel.component.file.remote.SftpOperations - Using known hosts information from file: C:\Users\user/.ssh/known_hosts
  org.apache.camel.component.file.remote.SftpOperations - Using StrickHostKeyChecking: no
  org.apache.camel.component.file.remote.SftpOperations - Using PreferredAuthentications: publicKey
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; Connecting to 192.168.84.243 port 22
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; Connection established
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; Remote version string: SSH-2.0-OpenSSH_5.3
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; Local version string: SSH-2.0-JSCH-0.1.54
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; SSH_MSG_KEXINIT sent
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; SSH_MSG_KEXINIT received
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: ssh-rsa,ssh-dss
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: none,zlib@openssh.com
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: none,zlib@openssh.com
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: 
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server: 
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: none
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: none
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: 
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client: 
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: server-&gt;client aes128-ctr hmac-md5 none
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; kex: client-&gt;server aes128-ctr hmac-md5 none
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; SSH_MSG_KEXDH_INIT sent
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; expecting SSH_MSG_KEXDH_REPLY
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; ssh_rsa_verify: signature true
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; Host '192.168.1.1' is known and matches the RSA host key
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; SSH_MSG_NEWKEYS sent
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; SSH_MSG_NEWKEYS received
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; SSH_MSG_SERVICE_REQUEST sent
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; SSH_MSG_SERVICE_ACCEPT received
  org.apache.camel.component.file.remote.SftpOperations - JSCH -&gt; Disconnecting from 192.168.1.1 port 22
  </code></pre>
  
  <p><p></p>
  
  <pre><code>org.apache.camel.component.file.remote.RemoteFileProducer - Could not connect to: sftp://user@192.168.1.1:22/messages/out?jschLoggingLevel=INFO&amp;preferredAuthentications=publicKey&amp;privateKeyFile=C%3A%2FUsers%2Fuser%2F.ssh%2Fid_rsa&amp;privateKeyPassphrase=xxxxxx. Will try to recover.
  org.apache.camel.component.file.GenericFileOperationFailedException: Cannot connect to sftp://user@192.168.1.1:22
      at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:146)
      at org.apache.camel.component.file.remote.RemoteFileProducer.connectIfNecessary(RemoteFileProducer.java:214)
      at org.apache.camel.component.file.remote.RemoteFileProducer.recoverableConnectIfNecessary(RemoteFileProducer.java:184)
      at org.apache.camel.component.file.remote.RemoteFileProducer.preWriteCheck(RemoteFileProducer.java:133)
      at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:113)
      at org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:58)
      at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
      at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:173)
      at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:436)
      at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168)
      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
      at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
      at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
      at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
      at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
      at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
      at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:460)
      at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:227)
      at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:191)
      at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
      at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  
  
  Caused by: com.jcraft.jsch.JSchException: Auth fail
      at com.jcraft.jsch.Session.connect(Session.java:519)
      at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:118)
      ... 27 more
  </code></pre>