Vsftpd Virtual Users

Installing Vsftpd Virtual Users and Password in text file

vsftpd is a reliable , fast and stable FTP server Daemon. In this article we’ll install the server and make it a  password text file for virtual users allowed to login.

1. Install following  packages using
sudo apt-get install  libpam-pwdfile vsftpd

2. Configure vsftpd (sudo nano /etc/vsftpd.conf)
Following variable need to be changed and leave others to default

local_enable=YES
write_enable=YES
anonymous_enable=NO
hide_ids=YES
local_umask=022
chroot_local_user=YES
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/var/www/$USER

local_root  is user’s home directories  in the machine

3. Manage PAM to check the passwd file for users (sudo nano /etc/pam.d/vsftpd)
auth required pam_pwdfile.so pwdfile /etc/ftpd.passwd
account required pam_permit.so
Remove other configuration from file
4. The passwd file containing the users is created
sudo htpasswd -c /etc/ftpd.passwd user1

Additional users to the file as below:
sudo htpasswd /etc/ftpd.passwd user2

5. Reload vsftpd
sudo /etc/init.d/vsftpd restart

6. User home directory should be created manually  since vsftpd doesn’t do it automatically
sudo mkdir /var/www/user1

7.Appropriate Permissions need to be provided to that folder for user ftp for uploads

chown 775 ftp:ftp /var/www/user1

email

Leave a Reply

Your email address will not be published. Required fields are marked *