1th Step
Go to Catalog
Cd/etc/vsftpd/vim vuser.list
Singular behavior account number, dual-action password.
111111111222222222
Using the Db_load command to generate FTP user database files with hash algorithm
Vuser.db:dbload-t-T hash-f vuser.list vuser.db
To view files:
File vuser.db
FTP Grants permissions:
chmod vuser.db
2nd Step
Create the user virtual and set it to not allow logging on to the system and define the user's home directory:
useradd-d/var/ftproot-s/sbin/nologin Virtual
To ensure that other users can access, give Rwxr-xr-x permissions:
CHMOD-RF 755/var/ftproot/
3rd Step: Establish a PAM authentication file that supports virtual users.
Vim/etc/pam.d/vsftpd.vu
The parameter db is used to point to the vuser.db file that was just generated
auth required pam_userdb.so db=/etc/vsftpd/vuseraccount required pam_userdb.so db=/etc/vsftpd/vuser
4th Step: Add the support configuration in the vsftpd.conf file.
Vi/etc/vsftpd/vsftpd.conf
Anonymous_enable=no
Local_enable=yes
Guest_enable=yes
Guest_username=virtual
Pam_service_name=vsftpd.vu
Allow_writeable_chroot=yes
Write_enable=yes
local_umask=022
Dirmessage_enable=yes
Xferlog_enable=yes
Connect_from_port_20=yes
Xferlog_std_format=yes
Listen=no
Listen_ipv6=yes
Userlist_enable=yes
Tcp_wrappers=yes
User_config_dir=/etc/vsftpd/vusers_dir
5th step: Set different permissions for the virtual user.
Specify the directory where the user independent permission profile resides:
Vim/etc/vsftpd/vsftpd.conf (User_config_dir=/etc/vsftpd/vusers_dir)
Create a directory where the user-independent permission profile resides:
mkdir/etc/vsftpd/vusers_dir/
Switch to enter the directory:
cd/etc/vsftpd/vusers_dir/
Create a blank 111
The configuration file:
Touch 111
Specify specific permissions for 222 users:
Vim 222
Anon_mkdir_write_enable=yes
Anon_other_write_enable=yes
6th step: Restart the VSFTPD service to verify the experimental results.
Systemctl Start VSFTPD
Systemctl Enable VSFTPD
Verify the permissions of the above two users on the client.
111 users cannot create folders, 222 users can create folders
~~
Linux FTP Create virtual users and Change permissions