1, Batch build 20 accounts, from USER1,USER2,USER20; password is user followed by five-bit random characters
[email protected] shell]# cat Guseradd
#!/bin/bash
For i in {1..20}; Do
x= "User"
pass= $x $ (tr-dc \~\ ' \[email protected]#\$\%\^\&\*\ (\) \-\_\+\=\|\\\?\/\.\>\,\<a-za-z0-9_ </dev/urandom |head-c 5|xargs) ##/dev/urandom generate random number #
Useradd User${i}
echo $pass | passwd user${i}--stdin # #stdin表示从标准输入读取令牌 # #
echo "User${i} <=============> $pass" >>./userlist.log
Done
Echo ' sucess,passwd is in Userlist.log '
2, Bulk Delete User1,user2...user20 these 20 accounts
#cat Guserdel
#!/bin/bash
For i in {1..20}; Do
Userdel-r User${i}
echo "User${i} is del" |tee-a Userdel.log
Done
echo "Sucess,users is deleted"
3, Mount \\10.10.1.1\SD shared folder, assuming that the account is User1, password is P4ssword,
Mkdir-p/MNT/SD
Mount-t CIFS//10.10.1.1/sd/mnt/sd-o User=user1,password=p4ssword
This article is from the "Wind Up! billows!" blog, be sure to keep this source http://superzxh.blog.51cto.com/27819/1675194
A few small scripts