Linux自动批量添加用户 - graybull's Blog

Linux自动批量添加用户

graybull posted @ 2013年4月08日 23:27 in Unix/Linux with tags linux shell auto add user , 2326 阅读

shell script如下:

该script从文件usernames中读取用户名,然后创建用户,并设置密码为:用户名+suffix

 

#!/bin/bash

suffix=123

for name in `awk '{print $0}' ./usernames`
do
#	echo $name
       useradd -d /home/${name} -g develop -s /bin/bash ${name}
#       echo ${name}${suffix}
       echo ${name}${suffix} | passwd ${name} --stdin
done

Avatar_small
temple run 说:
2018年12月18日 23:03

The information you share is great. I appreciate your sharing. Thank you very much

Avatar_small
hotmail login englis 说:
2019年7月09日 21:28

Thank you so much! I'm glad to find this post here, I learned a lot from it.

Avatar_small
Assignment Guarantee 说:
2020年6月24日 05:40

This code is informative. I found it lucky as I was stucked in a set of coding and this piece resolve my tensions. Thank you.

Avatar_small
Dissertation Writing 说:
2022年10月03日 10:31

This is bit confusing yet informative code. I copied it for showing some example in my dissertation. Keep it up.

Avatar_small
jnanabhumiap.in 说:
2024年1月11日 22:59

JNANABHUMI AP offers the most recent information on education. The primary idea or goal of this website has been to offer comprehensive resources with information on any subject that can be accessed online. To make sure that every reader finds out what they should know about the subject they are interested in and jnanabhumiap.in links to our content.Jnanabhumi AP is a startup founded by enthusiastic bloggers and webmasters who are driven to produce interesting, factual, and well-written content. We are similar to an online community where you can find a variety of resources, information, and topics about newsworthy events or daily occurrences.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee