I am getting an unexpected error with SFTP. I have...
# suitescript
n
I am getting an unexpected error with SFTP. I have checked the SuiteAnswers and the solution to remove the directory key didn't help. Any thoughts?
b
the sftp module is pretty unforgiving on improper usage
get anything wrong and you get an unexpected error
n
can you advise on anything that I should check? Everything looks good to me.
b
what does your code look like
n
Copy code
var obj = {    // establish connection to the FTP server
   username: config.USERNAME,
   //secret: 'custsecret_sftp_secret',
   passwordGuid: config.PASSWORD,
   url: config.ENDPOINT,
   hostKey: config.ADDITIONAL_CRED
};
var objConnection = sftp.createConnection(obj);
@battk
b
start with hardcoding the all your values
the specific values shared matter, so you may want to experiment with a free sftp server if you want to more freely share your values
n
Free SFTP servers are not allowing to generate the host key.
b
huh
that doesnt sound right
you dont generate the host key
you get it from the sftp server
n
yes, I know. but ssh-keyscan command is not allowed.
b
which server are you trying to get?
n
b
keys are available to me
what command are you doing to get the key
n
ssh-keyscan
b
the entire command?
n
ssh-keyscan -t rsa -p 22 test.rebex.net
I am getting the error message: ssh-keyscan is not supported (on the SSH terminal) and error code 127
Did it work at your end? which application are you using? I am using WinSCP.
b
your terminal sucks
use powershell or cmd
n
thanks @battk for your help. It worked using powershell.