First, you have to copy the code for generating Password GUID and Host key. It is suite let code for generating the GUIDs. Just copy that code and deploy the script and execute the script foe one time. While executing you have to mention the script which is going to use for SFTP connection.
You must include the sftp module.
// Establish a connection to a remote FTP server
let connection = sftp.createConnection({
username: ‘username of the SFTP server’,
passwordGuid: myPwdGuid(get the password guid from that suitelet page),
url: ‘URL of the SFTP server’,
directory: ‘/’,
hostKey: myHostKey (get the host key from the suitelet page).
});
Using this connection you can upload or download the file into SFTP server.
Use FileZilla for the verification purpose.