#### Install libpam-pwdfile
$ apt-get install libpam-pwdfile
####Build vsftpd_vuser for pam service (vsftpd_vusers)
$vi /etc/pam.d/vsftpd_vusers
# Customized login using htpasswd file
auth required pam_pwdfile.so pwdfile /etc/vsftpd/passwd
account required pam_permit.so
#### Use apache's htpasswd to build username&password
$htpasswd -c /etc/vsftpd/passwd USERA
$htpasswd /etc/vsftpd/passwd USERB
$chmod 600 /etc/vsftpd/passwd
####Build user_list
$vi /etc/vsftpd/user_list
USERA
USERB
#### Build account document and authority
$ vi /etc/vsftpd/user/USERA
local_root=/PATH/TO/USERA/ACCESS
$vi /etc/vsftpd/user/USERB
local_root=/PATH/TO/USERB/ACCESS
guest_username=REAL_USER_ACCOUNT
local_umask=002
#### Configure VSFTPD
$vi /etc/vsftpd.conf
pasv_min_port=xxxxx
pasv_max_port=yyyyy
listen_port=zz
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
userlist_deny=NO
userlist_file=/etc/vsftpd/user_list
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/user_list
xferlog_enable=YES
dual_log_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
tcp_wrappers=YES
## VUSER ##
pam_service_name=vsftpd_vusers
user_config_dir=/etc/vsftpd/user
virtual_use_local_privs=YES
guest_enable=YES
secure_chroot_dir=/var/run/vsftpd
hide_ids=YES
留言列表