node-ftps icon indicating copy to clipboard operation
node-ftps copied to clipboard

Download file via SFTP always require password

Open vicmonmena opened this issue 10 years ago • 2 comments

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

vicmonmena avatar Apr 21 '16 15:04 vicmonmena

Yes you can use requiresPassword: true and set the password so you won't have to input it manually every time.

atinux avatar Dec 09 '16 16:12 atinux

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?

oreaird avatar Mar 31 '19 22:03 oreaird