标签:mkdir yum col ffffff root pasv vsftp listen anon
yum -y install vsftpd
b. 修改配置文件:vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
c. 启动服务:
systemctl start vsftpd
d. 浏览器访问:
ftp://192.168.8.81
yum -y install db4-util
b. 设置密码文件:vim /etc/vsftpd/vlogin
lee
123456
c. 使密码文件生效:
db_load -T -t hash -f /etc/vsftpd/vlogin /etc/vsftpd/vlogin.db
chmod 600 /etc/vsftpd/{vlogin,vlogin.db}
d. 添加验证:vim /etc/pam.d/vsftpd.pam
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vlogin
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/vlogin
e. 设置系统账户:
useradd -s /sbin/nologin -d /home/ftp virtual
f. 修改配置文件:vim /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
listen=YES
listen_port=21
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=30999
pam_service_name=vsftpd.pam
user_config_dir=/etc/vsftpd_user_conf
user_sub_token=$USER
g. 建立用户配置文件夹:
mkdir /etc/vsftpd_user_conf
h. 创建用户目录:
mkdir /home/ftp/lee
i. 创建用户配置文件:vim /etc/vsftpd_user_conf/lee
local_root=/home/ftp/$USER
j. 启用服务:
systemctl start vsftpd
k. 浏览器访问:
ftp://192.168.8.81
![](http://i2.51cto.com/images/blog/201802/06/af5a07b752d09ef6d2514583d354ffca.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
标签:mkdir yum col ffffff root pasv vsftp listen anon
原文地址:http://blog.51cto.com/12173069/2069230