title: NiFi ListSFTP connector cannot connect to sftp server
body: <p>I have problems getting ListSFTP processor to work.</p>
  
  <p>First I have tested accessing the sftp server using the commandline on the NiFi server. This works but I have to provide the pass phrase of the private ssh key file.</p>
  
  <p>Then I made sure that I configured the ListSFTP processor using the same settings as the sftp commandline:</p>
  
  <ul>
  <li>Hostname: ip address of the server</li>
  <li>Port: 22</li>
  <li>Username: Username with access to the server and bound to the key</li>
  <li>Private Key Path: set to the full path of the file containing</li>
  <li>Private Key Phrase: password for the key file</li>
  <li>Remote path: . </li>
  <li>Strict Host Key Checking: false</li>
  <li>Host Key File: File hat contains the output of ssh-keyscan for the
  given server</li>
  </ul>
  
  <p>With these settings I get an error in the logfile. Any idea why NiFi cannot access the key file and access the sftp server. Cheers</p>
  
  <blockquote>
    <p>2020-03-19 15:43:19,736 ERROR [Timer-Driven Process Thread-2]
    o.a.nifi.processors.standard.ListSFTP
    ListSFTP[id=d343fa19-0170-1000-3352-999829a448cc] Failed to perform
    listing on remote host due to java.io.IOException: Failed to obtain c
    onnection to remote host due to com.jcraft.jsch.JSchException: invalid
    privatekey: [B@6d9b662: {} java.io.IOException: Failed to obtain
    connection to remote host due to com.jcraft.jsch.JSchException:
    invalid privatekey: [B@6d9b662
            at org.apache.nifi.processors.standard.util.SFTPTransfer.getChannel(SFTPTransfer.java:515)
            at org.apache.nifi.processors.standard.util.SFTPTransfer.getListing(SFTPTransfer.java:212)
            at org.apache.nifi.processors.standard.util.SFTPTransfer.getListing(SFTPTransfer.java:175)
            at org.apache.nifi.processors.standard.ListFileTransfer.performListing(ListFileTransfer.java:106)
            at org.apache.nifi.processors.standard.ListSFTP.performListing(ListSFTP.java:146)
            at org.apache.nifi.processor.util.list.AbstractListProcessor.listByTrackingTimestamps(AbstractListProcessor.java:472)
            at org.apache.nifi.processor.util.list.AbstractListProcessor.onTrigger(AbstractListProcessor.java:414)
            at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
            at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1162)
            at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:209)
            at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
            at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
            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:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748) Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@6d9b662
            at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)
            at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)
            at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
            at com.jcraft.jsch.JSch.addIdentity(JSch.java:407)
            at com.jcraft.jsch.JSch.addIdentity(JSch.java:388)
            at org.apache.nifi.processors.standard.util.SFTPTransfer.getChannel(SFTPTransfer.java:485)
            ... 18 common frames omitted</p>
  </blockquote>