Required Requirements:
Virtual users who are real, but cannot log in
FTP1 VFTP1
FTP2 VFTP2
VIP VVIP
VFTP1: can only download
VFTP2: can only upload
VVIP: That can upload and can download
Start the implementation step below:
Install the required software
Yum-y Install vsftpd DB4 db4-devel
First, create a user database
1. Create a user text file----> create three accounts
Vi/etc/vsftpd/ftpvuser.txt
Add three virtual accounts in it, one person user and password each line
Such as:
VFTP1---Users
VFTP1PW---vftp1 password
2. Build the database (to install the DB4 and Db4-devel packages beforehand)
Db_load-t-T Hash-f/etc/vsftpd/ftpvuser.txt/etc/vsftpd/vu.db
3. Modify database File access rights
chmod 600/etc/vsftpd/vu.db
Second, configure Pam file
Vi/etc/pam.d/vsftpd
The default configuration is all commented out or deleted, add two rows of corresponding configuration fields
Auth required/lib/security/pam_userdb.so Db=/etc/vsftpd/vu
Account Required/lib/security/pam_userdb.so Db=/etc/vsftpd/vu
PS: The above is 32-bit writing, the following is the 64-bit system:
Auth required/lib64/security/pam_userdb.so Db=/etc/vsftpd/vu
Account Required/lib64/security/pam_userdb.so Db=/etc/vsftpd/vu