
do
user=`echo $line|cut -d : -f 1`
useradd $user
password = `echo $line | cut -d : -f 2`
echo "$password" | passwd --stdin "$user"
done<userlist.txt
Linux下 Passwd有参数 --stdin This option is used to indicate that passwd should read the new password from standard input, which can be a pipe.
--stdin参数表明passwd可以从标准输入或者管道接收密码。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)