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

ftps.get returns permission denied #54

Open
n-for-all opened this issue Jun 25, 2017 · 2 comments
Open

ftps.get returns permission denied #54

n-for-all opened this issue Jun 25, 2017 · 2 comments

Comments

@n-for-all
Copy link

lftp command line works, except ftps.get returns permission denied
var FTPS = require('ftps');
this.client = new FTPS({
host: 'IP_ADDRESS', // required
username: 'USERNAME', // Optional. Use empty username for anonymous access.
password: 'PASSWORD', // Required if username is not empty, except when requiresPassword: false
protocol: 'ftp', // Optional, values : 'ftp', 'sftp', 'ftps', ... default: 'ftp'
// protocol is added on beginning of host, ex : sftp://domain.com in this case
port: 21, // Optional
// port is added to the end of the host, ex: sftp://domain.com:22 in this case
escape: true, // optional, used for escaping shell characters (space, $, etc.), default: true
retries: 2, // Optional, defaults to 1 (1 = no retries, 0 = unlimited retries)
timeout: 10, // Optional, Time before failing a connection attempt. Defaults to 10
retryInterval: 5, // Optional, Time in seconds between attempts. Defaults to 5
retryMultiplier: 1, // Optional, Multiplier by which retryInterval is multiplied each time new attempt fails. Defaults to 1
requiresPassword: true, // Optional, defaults to true
autoConfirm: true, // Optional, is used to auto confirm ssl questions on sftp or fish protocols, defaults to false
cwd: '', // Optional, defaults to the directory from where the script is executed
additionalLftpCommands: 'set xfer:clobber on', // Additional commands to pass to lftp, splitted by ';'
// requireSSHKey: true, // Optional, defaults to false, This option for SFTP Protocol with ssh key authentication
// sshKeyPath: '/home1/phrasee/id_dsa' // Required if requireSSHKey: true , defaults to empty string, This option for SFTP Protocol with ssh key authentication
});
var self = this;
// Do some amazing things
this.client.get('/test.txt').exec((err, resp) => {
console.log(resp);
});

resp returns permission denied, can u please look in to it?

thanks in advance.

@jeromew
Copy link
Contributor

jeromew commented Jun 28, 2017

Hello.
can you improve the formatting of your issue ?
"permission denied" means that the server refused to give you the permission.

It is going to be hard to debug for you without access to the server. You can maybe print by addings logs in the code the complete set of params that ftps is sending to the server.

@n-for-all
Copy link
Author

Hello,

Actually i found the issue and i wasn't able to resolve it, spawning the process doesn't give permissions to write files for that process, for example: if i list ftp directories using spawn, it works but not put or get file, permission denied is thrown, unless i run node as root, which works for files, however this is not an option, please note that my currrent nodejs can read and write but not spawn('lftp'), it fails with permission denied.

Thanks anyway

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