脚本
#!/bin/bash
echo “本地yum安装中”
rm -f /etc/yum.repos.d/*
mkdir /media/src
mount /dev/sr0 /media/src/ &> /dev/null
echo “[localyum]” >> /etc/yum.repos.d/localyum.repo
echo “baseurl=file:///media/src/” >> /etc/yum.repos.d/localyum.repo
echo “enabled = 1” >> /etc/yum.repos.d/localyum.repo
echo “gpgcheck = 0” >> /etc/yum.repos.d/localyum.repo
echo “完成”
systemctl stop firewalld
setenforce 0
执行apache安装
sh loca (tab)
yum -y install apr* pcre*
创建user.txt文件中的所有用户,并设置密码为123.com
vim /user.txt
添加:
zhang5
zhang6
zhang7
zhang8
zhang9
zhang10
zhang11
zhang12
zhang13
zhang14
zhang15
zhang16
vim useradd.sh
#!/bin/bash
a=cat /user.txt
for i in $a
do
useradd $i
echo “123.com” | passwd $i --stdin
done
执行 sh useradd.sh
来源:oschina
链接:https://my.oschina.net/u/4405841/blog/4776591