Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I simply test the connection ? #58

Open
omkartin opened this issue Aug 28, 2017 · 1 comment
Open

How can I simply test the connection ? #58

omkartin opened this issue Aug 28, 2017 · 1 comment

Comments

@omkartin
Copy link

Hey Atinux,

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

Please help me

@hardy925
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants