标签:passwd 批量创建 批量 add linux linu 用户 -- pen
1
echo admin{1..10}|xargs -n 1 | xargs -i echo ‘{}:openssl rand -base64 5‘ | awk -F":" ‘{print "useradd",$1";""x=$("$2");echo $x >> password.doc;echo $x""|""passwd --stdin",$1}‘ | bash
2
echo admin{1..10}|xargs -n 1 | xargs -i echo ‘{}:openssl rand -base64 5‘ | awk -F":" ‘{print "useradd",$1";x=$("$2");echo $x >> password.doc;echo $x|passwd --stdin",$1}‘
3
echo staff{1..10}|xargs -n 1|awk ‘BEGIN{pw="openssl rand -base64 5"}‘‘{print "useradd "$0";pass=$("pw");echo $pass>>/psw.sec;echo $pass|passwd --stdin "$0}‘ | bash
标签:passwd 批量创建 批量 add linux linu 用户 -- pen
原文地址:http://www.cnblogs.com/mirrorlake/p/7425528.html