I. key points of the article: The Virtual User configuration using PAM data in the 1.64-bit system 2. modifying the key script is successful. Necessary steps: detailed installation and configuration instructions. 3. fully configure the instance, Centos5.6 compile and install the vsftpd-2.3.4 (configure local user login, Virtual User login...
I. key points of the article:
Virtual User configuration using PAM data in a 1.64-bit system
2. the key script is successfully compiled. Necessary steps: detailed installation and configuration instructions.
3. full configuration instance, Centos5.6 build and install vsftpd-2.3.4 (configure local user login, Virtual User login)
Download
Wget http://xiazai.xiazaiba.com/Soft/V/vsftpd-2.3.4.tar.gz
Tar xzvf vsftpd-2.3.4.tar.gz
Cd vsftpd-2.3.4
Key steps: Because the SO file path of the 64-bit system changes, you must change the vsf_findlibs.sh script to change lib to lib64.
It can be manually modified or modified in batches.
Sed-I's/lib \ // lib64 \ // g' vsf_findlibs.sh will not be executed here. in a 64-bit system, make will fail.
Mkdir/var/ftp/
Useradd-d/var/ftp
Chown root. root/var/ftp/
Chmod og-w/var/ftp/
Make
Make install
Cd/etc/
Cp/etc/vsftpd. conf. rpmsave vsftpd. conf
II. detailed installation and configuration instructions:
1. install PAM first
Yum install pam-devel db4-utils
2. install vsftpd
Yum install vsftpd *
3. check whether vsftpd loads pam.
Ldd/usr/sbin/vsftpd
If ibpam. so.0 =>/lib/libpam. so.0 appears in the output, the load is successful.
4. Generate user authentication database files
1. create loguser.txt in the following format (user, password, user, password .....)
Userid
Pass
2) after saving the file, run db_load-T-t hash-f loguser.txt/etc/vsftpd/vsftpd_login.db to check whether the files in the directory are generated.
Set the access permission chmod 600/etc/vsftpd_login.db
5. vim/etc/pam. d/vsftpd
Add the following lines to the header:
Auth required/lib/security/pam_userdb.so db =/etc/vsftpd/vsftpd_login
Account required/lib/security/pam_userdb.so db =/etc/vsftpd/vsftpd_login
Note: If it is a 64-bit operating system, the path here should be changed
Auth required/lib64/security/pam_userdb.so db =/etc/vsftpd/vsftpd_login
Account required/lib64/security/pam_userdb.so db =/etc/vsftpd/vsftpd_login
Otherwise, a 530 error will be reported after vsftpd is started. I have found this error for a long time. the problem was not described in the similar instruction files on other websites.
Comment out other content
6. run vim/etc/vsftpd. conf to ensure that the following settings are included:
Anonymous_enable = NO
Local_enable = YES
Write_enable = NO
Anon_upload_enable = NO
Anon_mkdir_write_enable = NO
Anon_other_write_enable = NO
Chroot_local_user = YES
Guest_enable = YES
Guest_username = virtual // --- local user mapped here
Listen = YES
Listen_port = 21
Pasv_min_port = 30000
Pasvanderbilt max_port = 30999
7. start vsftpd
3. fully configure the instance
Centos5.6 compile and install vsftpd-2.3.4 (configure local user login)
Wget http://xiazai.xiazaiba.com/Soft/V/vsftpd-2.3.4.tar.gz
Tar zxvf vsftpd-2.3.4.tar.gz
Cd vsftpd-2.3.4
Mkdir-p/usr/local/man/man8
Mkdir-p/usr/local/man/man5
Make & make install
Cd ../
Vim/etc/vsftpd. conf
Mkdir/etc/vsftpd
Touch/etc/vsftpd/chroot_list
Echo "/usr/local/sbin/vsftpd &">/etc/rc. local
Mkdir/var/ftp
Touch/etc/vsftpd/userlist. chroot
Touch/etc/vsftpd/userlist_deny.chroot
Touch/var/log/vsftpd. log
Mkdir-p/usr/share/empty
# Firewall selinux settings
/Usr/local/sbin/vsftpd &
Setsebool-P ftpd_disable_trans on
/Sbin/iptables-I INPUT-p tcp -- dport 21-j ACCEPT
/Etc/rc. d/init. d/iptables save
/Etc/init. d/iptables restart
Useradd-d/home/wwwroot-s/sbin/nologin adminftp
Pkill vsftpd
/Usr/local/sbin/vsftpd &
Remember to set the adminftp password
Command: passwd adminftp and enter the new password twice
Please pay attention to the serialized articles. You are welcome to join us and discuss them. Buckle: ⑥ ⑤.
This article is from the "I am standing on the shoulders of giants, Jimmy Li" blog. please keep this source