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

How can I simply test the connection ?

Open omkartin opened this issue 8 years ago • 1 comments

Hey Atinux,

How would know that if there is a connection happened? I am using requireSSHKey: true and requirePassword:false

Please help me

omkartin avatar Aug 28 '17 15:08 omkartin

This is not an issue, rather it is a how-to question and is probably better suited for stackoverflow or some other network.

This is an example script I have used

const FTPS = require('ftps');

const ftps = new FTPS({
	host: '<host>',
	username:  '<user>',
	password: '<password>',
	protocol: 'sftp',
	timeout: 3000,
	port: <port>,
	autoConfirm: true
});

ftps.raw('set sftp:auto-confirm on')
    .cd('.')
    .raw('nlist')
    .exec((err, res) => {
    if(err) {
	console.log(err);
	process.exit(1);
    } else {
        console.log(res);
        process.exit(0)
    }
});

Good luck.

hardy925 avatar Jan 26 '18 18:01 hardy925