I. Environment and requirements 1. vsftpd Server IP Address: 192.168.32.312. The customer only allows access through netsword or zhxiaoyu (anonymous access is not allowed) access the ftp Server 3. netsword can upload files to server 2. vsftpd server (192.168.32.31) configuration 1. vsftpd installation [root @ station1 ~] # Yuminstallvsftpd. I
I. Environment and requirements
1.FtpD Server IP: 192.168.32.31
2. The customer can only access the ftp server through netsword or zhxiaoyu (anonymous access not allowed ).
3. netsword can upload files to the server
Ii. vsftpd server (192.168.32.31) Configuration
1. Install vsftpd
[Root @StatIon1 ~] # Yum install vsftpd. i386
[Root @ station1 ~] # Yum install db4-utiLs. I386 # used to generate a data file
2. Configure selinux
[Root @ station1 ~] #SetSebool-P ftp_home_dir = 1
3. Create a local ing user
[Root @ station1 ~] # UseraDd-D/var/ftp/vuserdir-s/sbin/nologin
[Root @ station1 ~] #ChmodO + rwx/var/ftp/vuserdir
4. Create and generate a virtual user data file
[Root @ station1 ~] # Vi/etc/vsftpd/vftpuser.txt
Netsword # User Name
Xiaobai # netsword Password
Zhxiaoyu # User Name
123456 # zhxiaoyu Password
[Root @ station1 ~] # Db_loCat-T-t hash-f/etc/vsftpd/vftpuser.txt/etc/vsftpd/vftpuser. db # generate a virtual user data file
[Root @ station1 ~] # Chmod 600/etc/vsftpd/vftpuser. db # enhance the security of virtual user data files
5. Modify the pam Authentication file/etc/pam. d/vsftpd to ensure vsftpd supports Virtual user authentication.
[Root @ station1 ~] # Vi/etc/pam. d/vsftpd # Add the following two lines to note all content:
Auth requirEd/Lib/security/pam_userdb.so db =/etc/vsftpd/vftpuser
Account required/lib/security/pam_userdb.so db =/etc/vsftpd/vftpuser
6. Modify/etc/vsftpd. conf (main configuration file of vsftp)
[Root @ station1 ~] # Vi/etc/vsftpd. conf
Guest _Enable= YES # Allow virtual users to log on
Guest_username = vuser # map a virtual user to a local user vuser
User_config_dir =/etc/vsftpd/vuser. conf # create special configurations for special users
Chroot_local_user = NO # Whether to lock the user to its home directory, 0 is not locked, 1 is locked
Max_per_ip = 2 # maximum number of connections with the same IP address
Anonymous_enable = NO # whether anonymous access is allowed
[Root @ station1 ~] # Vi/etc/vsftpd/vuser. conf/netsword # create special configurations for user netsword
Write_ Enable = yes
7. Start
[Root @ station1 ~] # Service vsftpd start
[Root @ station1 ~] #ChkconfigVsftpd on