This guide explains how to customize the ProFTPD configuration for FTP accounts created from the FTP Accounts section in the Client Area.
By default, additional FTP accounts have read-only access to your downloads directory. They can browse and download files, but they cannot upload or modify any data.
The steps below describe how to change the default directory for an FTP account, restrict users to specific directories and configure custom permissions.
Before you begin, log in to your service via SSH. If you need help, please refer to our SSH guide:
Changing the Default Directory
Each FTP account has its own home directory defined in the ProFTPD password file. By modifying this path, you can choose which directory a user will see immediately after logging in.
Step 1 – Edit the FTP Password File
The FTP account configuration is stored in:
~/software/proftpd/etc/ftpd.passwd
Before editing the file, grant yourself write permission. Otherwise you will receive a permission denied error.
chmod +w ~/software/proftpd/etc/ftpd.passwd
Open the file:
nano ~/software/proftpd/etc/ftpd.passwd
You will see entries similar to the following:
server:$1$etP95Zg8$RzMSLwfXD2d5BXuz/VfNu.:1000:1000::/home/server:/bin/false testftp:$1$WjNTpvHw$0jyWGI.w5MkB0ihi.Vt2M/:5001:5001::/home/server/downloads:/bin/false
Each FTP account has its own line. The directory near the end of the line defines the user's default login location.
Step 2 – Change the Login Directory
Locate the directory assigned to the user.
For example:
/home/server/downloads
Replace it with the directory you want the user to access after logging in.
For example, to make the user testftp log in directly to the ftpaccounts directory:
testftp:$1$WjNTpvHw$0jyWGI.w5MkB0ihi.Vt2M/:5001:5001::/home/server/downloads/ftpaccounts:/bin/false
Save the file by pressing F3, press Enter to confirm, then press F2 to exit.
Important: The directory you assign must already exist on the server. Otherwise the FTP user will not be able to log in.
Step 3 – Restrict Access to the Parent Directory
By default, the user will still be able to browse to the parent downloads directory.
If you want to restrict access so that the user can only access the assigned directory, edit the ProFTPD configuration:
nano ~/software/proftpd/etc/proftpd.conf
Find the following line:
<Directory /yourhome/yourusername/downloads>
Change it to:
<Directory /yourhome/yourusername/downloads/*>
Save the file by pressing F3, press Enter to confirm and then press F2 to exit.
Step 4 – Restart the FTP Server
Restart your FTP server to apply the new configuration.
After restarting, the FTP account will log in directly to the configured directory and will no longer have access to the parent downloads directory.
Restricting Different Users to Different Directories
You can configure each FTP account to access a different directory and assign different permissions to each user.
For example, one user can access downloads/ftpaccount1, while another user can access downloads/ftpaccount2.
Step 1 – Set the User's Login Directory
First, edit the FTP password file:
~/software/proftpd/etc/ftpd.passwd
Configure the user's login directory as described in the previous section.
If required, open the file again using:
nano ~/software/proftpd/etc/ftpd.passwd
Step 2 – Edit the ProFTPD Configuration
Open the ProFTPD configuration file:
nano ~/software/proftpd/etc/proftpd.conf
Add the following block at the end of the file:
<Directory /home/yourusername/downloads/custompath> <Limit STAT LSTAT DIRS READ> AllowUser user </Limit> </Directory>
Step 3 – Customize the Configuration
Replace:
<Directory /home/yourusername/downloads/custompath>
with the directory that the FTP account should be allowed to access.
Then replace:
AllowUser user
with the FTP username that should have access to that directory.
For example:
<Directory /home/yourusername/downloads/ftpaccess> <Limit STAT LSTAT DIRS READ> AllowUser ftpacc1 </Limit> </Directory>
Save the file by pressing F3, press Enter to confirm and then press F2 to exit.
Step 4 – Restart the FTP Server
Restart your FTP server to apply the new configuration.
The selected FTP account will now only have access to the configured directory.
Changing Permissions for Individual Users
You can also customize the permissions granted to each user.
By default, the configuration uses:
<Limit STAT LSTAT DIRS READ>
Add any additional permissions you want to grant.
For example, to allow uploads, change it to:
<Limit STAT LSTAT DIRS READ WRITE>
The permissions defined inside each <Limit> block apply only to the directory configured for that user.
Granting Upload (WRITE) Permission
By default, additional FTP accounts have read-only access. They can browse and download files, but they cannot upload, modify or delete them.
If you want FTP users to upload files, you need to grant the WRITE permission.
Step 1 – Edit the ProFTPD Configuration
Open the ProFTPD configuration file:
nano ~/software/proftpd/etc/proftpd.conf
Find the following section:
<Directory /home/yourusername/downloads/*> <Limit STAT LSTAT DIRS READ> AllowAll </Limit> </Directory>
Step 2 – Enable WRITE Permission
Add WRITE to the <Limit> directive so it becomes:
<Limit STAT LSTAT DIRS READ WRITE>
Save the file by pressing F3, press Enter to confirm and then press F2 to exit.
What Does WRITE Allow?
Granting the WRITE permission enables the following FTP commands:
APPE, DELE, MKD, RMD, RNTO, STOR, STOU, XMKD, XRMD
This allows users to upload files, but it also allows them to delete files and directories.
Allow Uploads Without DELETE Permission
If you want users to upload files but prevent them from deleting data, replace WRITE with the required permissions individually.
For example:
<Limit STAT LSTAT DIRS READ APPE MKD RMD RNTO STOR STOU XMKD XRMD>
This grants upload-related permissions without enabling the DELE command.
Step 3 – Restart the FTP Server
Restart your FTP server to apply the new configuration.
Additional Information
For a complete list of available <Limit> directives and FTP permissions, please refer to the official ProFTPD documentation:
http://www.proftpd.org/docs/howto/Limit.html
Notes
- By default, additional FTP accounts have read-only access.
- The WRITE permission also grants the ability to delete files and directories.
- If you want to allow uploads without allowing file deletion, specify the required FTP permissions individually instead of using WRITE.
- Restart the FTP server after making any configuration changes.