Create ftp users

I am trying to create a FTP user with its own home directory, and to lock it to his own home directory.
I don’t want it to be able to navigate to upper directory.
I’ve been trying to create a user with useradd command, but I have to issue :

  • by default the user is not chrooted and we can access to the whole filesystem
    I add the “-A” parameter in the /etc/init.d/pureftpd init script in order to chroot everyone but with SSH I am able to connect and to go to upper folder.
  • if I set the shell to /bin/false (to disable SSH connection), I can’t connect using FTP.

Any help would be appreciated. Thanks.
Quentin.

1 Like

Hi,
the described way should work to limit the FTP access. In the past, I made the following steps:
→ “useradd -d /home/ftp/ ftp_user”
→ “passwd ftp_user”
→ Added the -A parameter in /etc/init.d/pureftpd
I am not sure, why you need to disable SSH but this had no effect on the FTP access in my test after disabling it in the WBM. SSH is handled by the process dropbear and FTP by pure-ftpd.
Consider that SFTP is SSH based and will not work, when SSH is disabled.

Best regards
Juri

Hi Juri,
I don’t want to globally disable the SSH access, but I don’t want the created user to be able to login with SSH, only FTP.

Any idea ?

Hi,
please try out “useradd …-s /usr/sbin/nologin…” command, when creating the new FTP-User.

Best regards
Juri

Unfortunately it doesn’t work, I can’t even log using FTP when I set this option