Hostxpeed
Login Get Started →
Server Management

How to Create FTP User

6 min read
22 views
Jun 10, 2026

Prerequisites

Before creating an FTP user, make sure you have:

  • SSH access to your VPS
  • Root or sudo privileges
  • FTP server installed (vsftpd recommended)

Step 1: Install vsftpd

Connect to your VPS:

ssh hxroot@YOUR_SERVER_IP -p 22
sudo apt update
sudo apt install vsftpd -y

Step 2: Configure vsftpd

sudo nano /etc/vsftpd.conf

Ensure these settings:

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=30010
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO

Restart vsftpd:

sudo systemctl restart vsftpd
sudo systemctl enable vsftpd

Step 3: Create a System User for FTP

sudo adduser ftpuser

Set password and details.

Option: Create user with no shell (for security):

sudo useradd -m -d /home/ftpuser -s /usr/sbin/nologin ftpuser
sudo passwd ftpuser

Step 4: Add User to vsftpd Userlist

echo "ftpuser" | sudo tee -a /etc/vsftpd.userlist

Step 5: Set Directory Permissions

The FTP user's home directory should be owned by the user:

sudo chown -R ftpuser:ftpuser /home/ftpuser
sudo chmod 755 /home/ftpuser

Step 6: Open Firewall Ports

sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 30000:30010/tcp

Step 7: Connect via FTP Client

Use FileZilla, WinSCP, or command line:

ftp YOUR_VPS_IP

Enter username ftpuser and password.

Create FTP User with Access to Specific Directory

For a user who should only access /var/www/mysite:

sudo useradd -d /var/www/mysite -s /usr/sbin/nologin webftp
sudo passwd webftp
echo "webftp" | sudo tee -a /etc/vsftpd.userlist
sudo chown -R webftp:webftp /var/www/mysite

Test FTP Connection

ftp YOUR_VPS_IP 21
# Login with ftpuser
# run: ls
# run: quit

Secure FTP with SSL/TLS (FTPS)

Generate certificate:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem

In vsftpd.conf add:

ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem

Restart:

sudo systemctl restart vsftpd

✅ FTP user created. Users can now upload/download files via FTP.

Was this article helpful?