Download file via SFTP always require password
Hi!
When I try to download a file via SFTP, input password manually is always required:
var ftps = new FTPS({
host: ...,
username: ...,
password: ...,
protocol: 'sftp',
port: ...,
requiresPassword: false,
autoConfirm: true
});
ftps.get(pathToRemoteFile, [pathToLocalFile])
ftps.exec(...)
Is requiresPassword parameter to avoid that?
Thanks
Yes you can use requiresPassword: true and set the password so you won't have to input it manually every time.
I am having the exact same issue even though (like the op's example) I have both password and requires password filled in.
When I run the script it sits at the "password: " and unless I enter it manually it times out with max retreis exceeded. What is the fix of this? I have the option password, but its not auto filling it it.
` const Client = require('ftps');
let sftp = new Client({
host: '[REDACTED]',
username: '[REDACTED]-sftp-user',
password: '[REDACTED]',
port: '22',
protocol: 'sftp',
retries: 2,
requiresPassword: true,
autoConfirm: true,
});
sftp.put('test.txt').exec(console.log);
Am getting this
[REDACTED]-sftp-user@[REDACTED].host's password: null { error:
'put: test.txt: Fatal error: max-retries exceeded\n',
data: '' }
`
The options definitely have the password, which if I copy paste when it's sitting at 'password:' then it works. Any idea what I am missing?