Restrict FTP users to a directory Print

  • 26

The first step is to install a FTP server. You can find how to do it here: https://secure.servergrove.com/clients/knowledgebase.php?action=displayarticle&id=153

Once the server is installed, you have to configure the users that will connect with FTP.

To add a user with permissions for a specific domain, you have to set the vhost directory as the user's homedir.

useradd -m -d /var/www/vhosts/example.com/httpdocs USERNAME

or if you want to disable shell access for the user

useradd -m -d /var/www/vhosts/example.com/httpdocs -s /sbin/nologin USERNAME

Now the user is created and is able to connect to the server with any FTP client.

 

IMPORTANT: Shell access will allow the user access to all readable files on your server.


Was this answer helpful?

« Back