'N/sftp Module - FTP_CANNOT_ESTABLISH_CONNECTION

I need to use a private rsa key to connect to a server, the file contains the key as follows.

-----BEGIN OPENSSH PRIVATE KEY-----
key 
-----END OPENSSH PRIVATE KEY-----

when I try to upload it, Setup/Compagny/Keys/add I get the following error: Unexpected Error

If I try to convert it to .pem with the following bash command:

ssh-keygen -p -N "" -m pem -f /path/to/key 

(console log Key has comment 'amillet@LAPTOP-Q89B7RU7' Your identification has been saved with the new passphrase)

I am able to create the key so I am trying to establish a connection with the code bellow :

sftp.createConnection({
    username: ID_OF_CONNECTION,
    keyId: KEY_ID
    hostKey: HOST_KEY,
    url: URL_SERVER,
    port: PORT_SERVER,
    });

I get the following error:"FTP_CANNOT_ESTABLISH_CONNECTION", "details": "Could not establish connection to Auth fail. ",

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

In my code HOST_KEY is the result of

ssh-keyscan -t rsa -p ${PORT_SERVER} ${URL_SERVER} 

executed from my terminal

I can't understand why the same information from fileZilla allows me to connect to the server but not from NEtsuite.



Solution 1:[1]

my solution was to output tsc emitted files into tsc-out folder inside the src folder and delete it after with pre- and post- npm scripts.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 stackcen