#!/bin/bash
USER1=lin
USER1P=123
USER2=fan
USER2P=456
#close firewalld and selinux
setenforce 0
sed -ri 's/^(SELINUX=).*/\1disabled/g' /etc/sysconfig/selinux
systemctl stop firewalld
systemctl disable firewalld
#install software
cd /etc/yum.repos.d/
mv * /tmp/
curl -o 163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
sed -i 's/\$releasever/7/g' /etc/yum.repos.d/163.repo
sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/163.repo
yum -y install wget epel-release vsftpd &>/dev/null
#touch list of user and passwd
cat >> /etc/vsftpd/vu.list <<EOF
$USER1
$USER1P
$USER2
$USER2P
EOF
#anzhaung db4
yum -y install db4* &>/dev/null
#jiang gang chuang jiang de list shiyong db4 zhuanhuawei myself
db_load -T -t hash -f /etc/vsftpd/vu.list /etc/vsftpd/vu.db
# shezhi quanxian
chmod 600 /etc/vsftpd/vu.*
#add user touch ftp
useradd -d /var/ftproot -s /sbin/nologin vftp
chmod 755 /var/ftproot/
# PAM renzheng
cp /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak
cat > /etc/pam.d/vsftpd <<EOF
#%PAM-1.0
auth required pam_userdb.so db=/etc/vsftpd/vu
account required pam_userdb.so db=/etc/vsftpd/vu
EOF
#xiu gai vftpd
cat >> /etc/vsftpd/vsftpd.conf <<EOF
guest_enable=YES
guest_username=vftp
user_config_dir=/etc/vsftpd/vusers_dir
allow_writeable_chroot=YES
EOF
# touch /etc/vsftpd/vuser_dir
if [ ! -d /etc/vsftpd/vusers_dir ];then
mkdir /etc/vsftpd/vusers_dir
fi
#she zhi vusers quanxian
cat >> /etc/vsftpd/vusers_dir/$USER1 <<EOF
anon_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
EOF
touch /etc/vsftpd/vusers_dir/$USER2
#start service
systemctl start vsftpd &>/dev/null
systemctl enable vsftpd &>/dev/null
ss -antl
vsftpd脚本自动化运行编写案例
原创
©著作权归作者所有:来自51CTO博客作者上古杰作的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:NFS服务脚本形式安装实例
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
运维自动化【打包python脚本为exe,在win下双击运行。】
python脚本打包为exe,并下载图片。
json 计划任务 python脚本 -
自动化脚本编写指南
测试脚本的规范编写有利于后期的维护,下面介绍脚本编写过程中需要注意到几个方面:
职场 脚本 休闲 自动化 -
ixchariot 自动化脚本测试案例 自动化测试脚本开发
通常对于一个稍具规模的系统,一些新的改动势必会带来一些额外的功能回归测试工作,而这个工作是非常繁杂的,人肉的方式一次又一次的重复将会非常的枯燥乏味。 而我们所希望的,是一种自动化回归脚本的方式,可以重复性的回归现有功能,并给出回归测试报告。 &n
ixchariot 自动化脚本测试案例 测试 python browser 浏览器