本文共 1045 字,大约阅读时间需要 3 分钟。
#!/bin/bash
#This is install vsftpd script
mount /dev/sr0 /mnt/yum -y install vsftpd
echo "w1
123w2123w3123" >/etc/vsftpd/userdb_load -T -t hash -f /etc/vsftpd/user /etc/vsftpd/user.db
echo "#PAM-1.0
auth required pam_usredb.so db=/etc/vsftpd/useraccount required pam_userdb.so db=/etc/vsftpd/user" >/etc/pam.d/xiaoxiannvuseradd -m -s /sbin/nologin duanyufei
sed -i '/^#/d' /etc/vsftpd/vsftpd.conf
sed -i '1a anon_root=/ftproot/\nguest_enable=YES\nguest_username=duanyufei\nuser_config_dir=/etc/vsftpd/virtual' /etc/vsftpd/vsftpd.confsed -i '/^pam/ s/vsftpd/xiaoxiannv/' /etc/vsftpd/vsftpd.confsed -i '$a pasv_enable=YES\npasv_min_port=10000\npasv_max_port=11000' /etc/vsftpd/vsftpd.confmkdir /etc/vsftpd/virtualmkdir -p /ftproot/anonymous/chmod 757 /ftproot/anonymous/touch /etc/vsftpd/virtual/w2touch /etc/vsftpd/virtual/w3
echo "anon_upload_enable=YES
anon_mkdir_write_enable=YESanon_other_write_enable=YES" >/etc/vsftpd/virtual/w1/etc/init.d/vsftpd start
chkconfig --level 35 vsftpd on转载于:https://blog.51cto.com/14013608/2314794