Add username and password without interaction when the system administrator needs to add a user, use the adduser command to interact with the system to create an account. If you create users in batches, we recommend that you use the useradd command. the shell script is as follows: 1 #! /Bin/bash2password & quot; 123456 & quot; 3for...
Add username and password without interaction when the system administrator needs to add a user, use the adduser command to interact with the system to create an account. If you create users in batches, we recommend that you use the useradd command. the shell script is as follows: 1 #! /Bin/bash2 password = "123456" 3 for USER in user1 user2 user34 do5 sudo useradd-m $ USER6 echo-e "$ {password} \ n $ {password}" | sudo passwd $ USER7 done
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