1. Add a user group
# groupadd www
2. modify the configuration
# vi /etc/vsftpd/vsftpd.conf
Find:
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
change into:
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
3. Increase user
# useradd -g www -d /dir/to -M ftpuser
4. Set the user password
# passwd ftpuser
5. Edit user files:
# vi /etc/vsftpd/chroot_list
Each user per line, such as:
peter
john
6. Restart vsftpd
# service vsftpd restart
7. Complete
the first setting step 1-5,
after each additional user, only 3-5 steps to execute.
Changed user belonging group
# chown -R www:www /var/www/html/domain.com/htdocs
Set with the same rights as the same group of users, to avoid nginx, php, ftp inoperable problem
# chmod -R g+rwx /var/www/html/domain.com/htdocs
Reproduced in: https: //my.oschina.net/zhouz/blog/213100