#!/bin/bash
userchars="old"
for num in `seq 3`
do
useradd $userchars$num
passwd=`date|md5sum|cut -c3-20`
echo "$passwd"|passwd --stdin $userchars$num
echo -e "user:$userchars$num\tpasswd:$passwd">>/tmp/user.log
done
+++++++++++++++++++++++++++++++
[root@localhost scripts]# cat /tmp/user.log
user:old1 passwd:f8d7c14dcc8299ef95
user:old2 passwd:bf56af4f30ae92d823
user:old3 passwd:baca557bee56578e84
2016-11-23
批量添加用户和密码随机密码
评论
发表评论
姓 名: