标签:tcp mkdir red 根目录 for list 重复 install 安装
yum install vsftpd db4 db4-utils
useradd vsftpd -d /home/vsftpd -s /sbin/nologin
vi /etc/vsftp.conf
设置以下配置项
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=vsftpd
user_config_dir=/etc/vsftpd/vuser_conf
allow_writeable_chroot=YES
vim /etc/vsftpd/vuser_passwd.txt
(注意奇数行是用户名,偶数行是密码),添加以下内容:
ftp1
123456
执行以下命令:
db_load -T -t hash -f /etc/vsftpd/vuser_passwd.txt /etc/vsftpd/vuser_passwd.db
全部注释掉原来语句,再增加以下两句:
auth required pam_userdb.so db=/etc/vsftpd/vuser_passwd
account required pam_userdb.so db=/etc/vsftpd/vuser_passwd
mkdir /etc/vsftpd/vuser_conf/
vi /etc/vsftpd/vuser_conf/ftp1
注:文件名ftp1 等于vuser_passwd.txt里面的账户名,否则下面设置无效
文件中添加以下内容:
# 虚拟用户根目录,根据实际情况修改
local_root=/home/vsftpd
#可写
write_enable=YES
anon_umask=022
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
systemctl start vsftpd
systemctl enable vsftpd
firewall-cmd --add-service=ftp --permanent
systemctl restart firewalld
如果还需要继续添加新用户,请重复步骤4,5,7
标签:tcp mkdir red 根目录 for list 重复 install 安装
原文地址:https://www.cnblogs.com/orochihuang/p/14107088.html