1、创建用户及密码
touch user #创建用户存放文件
[root@bogon sh]# cat user
xiaoming
xiaowang
wangwu
lisi
xiaoqiang
vim user.sh #创建脚本
#!/bin/bash
#创建linux用户
for i in `cat user`
do
useradd $i -d /home/"$i"
echo '123456' | passwd --stdin "$i"
done
cat /etc/passwd
xiaoming:x:1001:1001::/home/xiaoming:/bin/bash
xiaowang:x:1002:1002::/home/xiaowang:/bin/bash
wangwu:x:1003:1003::/home/wangwu:/bin/bash
lisi:x:1004:1004::/home/lisi:/bin/bash
xiaoqiang:x:1005:1005::/home/xiaoqiang:/bin/bash
2、