Shell script, create 10 system accounts in bulk and set the password to a random 8-bit string.

Source: Internet
Author: User

[Email protected] wyb]#CatUser10.SH #!/bin/bash# Batch creation of 10 system accounts wangyb01-WANGYB10 and set the password (the password is a random 8-bit string). >user.list forUserinch`seq-W Ten` Douseradd wangyb$user Password=`Echo$RANDOM |md5sum|Cut-C1-8`   Echo$password |passwdWangyb$user--stdinEchoWangyb$user $password >>user.list Done[email protected] wyb]# bash user10.SHCreating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb01.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb02.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb03.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb04.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb05.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb06.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb07.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb08.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser wangyb09.passwd: All authentication tokens updated successfully. Creating Mailboxfile: File existsuseradd:warning:the home directory already exists. Not copying anyfileFrom Skel directory to it. changing password foruser Wangyb10.passwd: All authentication tokens updated successfully. [Email protected] wyb]#Catuser.list wangyb01 77950e07wangyb02 ace3cfb1wangyb03 2cd63081wangyb04 0f891e3cwangyb05 600bedd4wangyb06 73d3dfdcwangyb0730740006wangyb08 54cf685fwangyb09 ee3f88afwangyb10 b54d2555[[email protected] wyb]#suwang01su: User wang01 does not exist[[email protected] wyb]#suWangyb01[[email protected] wyb]$suWangyb10password: [[email protected] wyb]$ [[email protected] wyb]#CatDeluser10.SH #!/bin/bash# Delete 10 system accounts in bulk WANGYB01-WANGYB10 and set the password (the password is a random 8-bit string). >user.list forUserinch`seq-W Ten` DoUserdel Wangyb$user Done[email protected] wyb]# bash deluser10.SH[email protected] wyb]#suWANGYB01su: User wangyb01 does not exist[[email protected] wyb]#

Shell script, create 10 system accounts in bulk and set the password to a random 8-bit string.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.