I rarely have need to access sFTP. When I have, I'...
# suitescript
n
I rarely have need to access sFTP. When I have, I've connected with username / passwordGUID. If I was to store the GUID in a "secret", could I use username / secret? 🤔 Or am I misunderstanding the use case for secret and it's tied directly to 2FA (or something entirely different)?
a
When you use username and secret you don't need passwordGUID.
Copy code
const oConnect = sftp.createConnection({
    username: pData.USERNAME,
    secret: pData.SFTP_SECRET,
    url: pData.HOST,
    directory: '/',
    hostKey: pData.HOST_KEY,
    hostKeyType: 'rsa'
});
Password GUID can't be used combined with secret, password GUID is the old way to encrypt if you will a password, while secret is kind of a replacement for that.
Copy code
secret: pData.SFTP_SECRET
This variable holds the ID of a NetSuite Secret created via API Secrets.
n
Ok so, as I was starting to think, store the password in a secret and use
secret: custsecret_
or (old skool) use the GUID and
passwordGuid: "that long guid"
Thank you for clarifying