mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 244 forks source link

Connect directly into specified remote directory #283

Open emrealparslan93 opened 1 year ago

emrealparslan93 commented 1 year ago

Hello,

I've a user that is allowed to specific directory in FTP server. While connecting to ftp server using host, port, username and password, I get the error below:

User cannot log in, home directory inaccessible. 530

I know that my user is only allowed to specific directory like /user/dir, but I do not know how to connect directly into it.

I'm sharing my code snippet below:

  client.connect({
        host: "xx.xxx.xx.xxx",
        user: "username",
        password: "pass",
        secure: true,
        secureOptions: {
              rejectUnauthorized: false,
              key: key,
              cert: crt
          }
      });

As I know secureOptions is same with tls.connect() options and I tried to add path into secureOptions but it didn't work.

How can I connect to specific directory in remote?