title: N/sftp Module - FTP_CANNOT_ESTABLISH_CONNECTION
body: <p>I need to use a private rsa key to connect to a server, the file contains the key as follows.</p>
  <pre><code>-----BEGIN OPENSSH PRIVATE KEY-----
  key 
  -----END OPENSSH PRIVATE KEY-----
  </code></pre>
  <p>when I try to upload it, Setup/Compagny/Keys/add
  I get the following error: Unexpected Error</p>
  <p>If I try to convert it to .pem with the following bash command:</p>
  <pre><code>ssh-keygen -p -N &quot;&quot; -m pem -f /path/to/key 
  </code></pre>
  <p>(console log Key has comment 'amillet@LAPTOP-Q89B7RU7'
  Your identification has been saved with the new passphrase)</p>
  <p>I am able to create the key so I am trying to establish a connection
  with the code bellow :</p>
  <pre><code>sftp.createConnection({
      username: ID_OF_CONNECTION,
      keyId: KEY_ID
      hostKey: HOST_KEY,
      url: URL_SERVER,
      port: PORT_SERVER,
      });
  </code></pre>
  <p>I get the following error:<strong>&quot;FTP_CANNOT_ESTABLISH_CONNECTION&quot;, &quot;details&quot;: &quot;Could not establish connection to Auth fail. &quot;</strong>,</p>
  <p>I then tried to connect via FileZilla with the same file (KEY_ID) and the same information, except the HOST_KEY is retrieved by filezilla</p>
  <p>In my code HOST_KEY is the result of</p>
  <pre><code>ssh-keyscan -t rsa -p ${PORT_SERVER} ${URL_SERVER} 
  </code></pre>
  <p>executed from my terminal</p>
  <p>I can't understand why the same information from fileZilla allows me to connect to the server but not from NEtsuite.</p>