1. create the logins.txt/etc/vsftpd/login.txt file of the virtual user database as follows, even line set password 2, generate vsftpd authentication file # db_load-T-thash-f/etc/vsftpd/logins.txt/et...
1. create the logins.txt file of the virtual user logging database.
The/etc/vsftpd/login.txt file contains the following content:
Set the username for odd lines in the password library file, and set the password for even lines
2. Generate the authentication file for vsftpd
# Db_load-T-t hash-f/etc/vsftpd/logins.txt/etc/vsftpd/login. db # Generate the authentication database file login. db
Note: If the db_load command is not available, install the following RPM package.
3. set the authentication file to be readable and writable only to the root user.
# Chmod 600/etc/vsftpd/login. db
4. create the PAM configuration file required by the virtual user and manually create the vsftpd. vu file.
# Vim/etc/pam. d/vsftpd. vu:
5. create a system user account used by all FTP virtual user accounts, and set permissions for the home directory of the account.
# Useradd-s/sbin/nologin-d/home/vftp
6. set the vsftpd. conf configuration file.
# Vi/etc/vsftpd. conf
Add virtual user configuration content to the configuration file (it is best to disable anonymous accounts)
Guest_enable = YES
Guest_username = vftp
Pam_service_name = vsftpd. vu (to correspond to the PAM file just created)
User_config_dir =/etc/vsftpd/user_config_dir (specify the configuration directory for each virtual user account ,)
Local_root =/ftpsite (this line does not exist. the virtual user logs on to/home/vftp)
7. configure virtual user name settings
# Mkdir-p/etc/vsftpd/user_config_dir (corresponding to the main configuration file)
# Mkdir-p/ftpsite/vuser1 (create a virtual home directory)
# Chmod-R 777/ftpsite/vuser1 (set permissions)
# Vi/etc/vsftpd/user_config_dir/vuser1 (vuser1 permission configuration file), the content is as follows:
Anon_world_readable_only = NO
Write_enable = YES
Anon_upload_enable = YES
Anon_other_write_enable = YES
Local_root =/ftpsite/vuser1
Anon_mkdir_write_enable = YES
Create a vuser2 Virtual User configuration file in the same way.
8. restart the vsftpd service program.
9. use a virtual account to log on to the system as follows:
This article is not only a personal honor, "blog