标签:nbsp 本地用户 x86 firewall anon ftpd bak async down
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/vsftpd-3.0.2-25.el7.x86_64.rpm
rpm -ivh vsftpd-3.0.2-25.el7.x86_64.rpm
useradd ftpuser -s /sbin/nologin
echo "96@wB&RjaAql" | passwd --stdin ftpuser
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf_bak`date "+%Y%m%d"`
echo ‘‘ > /etc/vsftpd/vsftpd.conf
echo "dirmessage_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "ftpd_banner=Welcome to login FTP service." >> /etc/vsftpd/vsftpd.conf
echo "anonymous_enable=NO" >> /etc/vsftpd/vsftpd.conf
echo "anon_upload_enable=NO" >> /etc/vsftpd/vsftpd.conf
echo "anon_mkdir_write_enable=NO" >> /etc/vsftpd/vsftpd.conf
echo "anon_other_write_enable=NO" >> /etc/vsftpd/vsftpd.conf
echo "xferlog_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "xferlog_std_format=YES" >> /etc/vsftpd/vsftpd.conf
echo "xferlog_file=/var/log/vsftpd.log" >> /etc/vsftpd/vsftpd.conf
echo "async_abor_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "ascii_upload_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "ascii_download_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "connect_from_port_20=NO" >> /etc/vsftpd/vsftpd.conf
echo "pasv_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "pasv_min_port=55000" >> /etc/vsftpd/vsftpd.conf
echo "pasv_max_port=56000" >> /etc/vsftpd/vsftpd.conf
echo "write_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "cmds_allowed=FEAT,REST,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RMD,RNFR,RNTO,RETR,DELE,SIZE,TYPE,USER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST,STOR" >> /etc/vsftpd/vsftpd.conf
echo "local_umask=022" >> /etc/vsftpd/vsftpd.conf
echo "userlist_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "userlist_deny=NO" >> /etc/vsftpd/vsftpd.conf
echo "pam_service_name=vsftpd" >> /etc/vsftpd/vsftpd.conf
详情请参考:https://blog.csdn.net/woshijipinglong/article/details/92636979
sed -i ‘s/pam_shells.so/pam_nologin.so/g‘ /etc/pam.d/vsftpd
setenforce 0
sed -i "/SELINUX=enforcing/c\SELINUX=disabled" /etc/selinux/config
systemctl disable firewalld && systemctl stop firewalld && systemctl status firewalld
echo ‘‘ > /etc/vsftpd/user_list
echo "local_enable=YES" >> /etc/vsftpd/vsftpd.conf
echo "chroot_local_user=YES" >> /etc/vsftpd/vsftpd.conf
echo "allow_writeable_chroot=YES" >> /etc/vsftpd/vsftpd.conf
echo "chroot_list_enable=NO" >> /etc/vsftpd/vsftpd.conf
echo "ftpuser" >> /etc/vsftpd/user_list
systemctl enable vsftpd && systemctl restart vsftpd &&systemctl status vsftpd
yum -y install ftp
ftp
open 127.0.0.1 21
ftpuser
96@wB&RjaAql
put test
get test
delete test
ls
echo "" >> /etc/vsftpd/vsftpd.conf
echo "" >> /etc/vsftpd/vsftpd.conf
echo "" >> /etc/vsftpd/vsftpd.conf
标签:nbsp 本地用户 x86 firewall anon ftpd bak async down
原文地址:https://www.cnblogs.com/jipinglong/p/11230851.html