LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-09-2011, 12:09 PM   #1
sai_bbsr
LQ Newbie
 
Registered: Dec 2011
Location: New Delhi,India
Posts: 1

Rep: Reputation: Disabled
Question Linux user adding


I am using redhat linux.My question is "How to add multiple user in a single shot"...
Means like we use the command for adding the user is #useradd [username]

It is a time taking process so i want that add no. of user at a time..
 
Old 12-09-2011, 12:49 PM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
you could write a script?

First create a doc with all new users you'd like to create - each on a new line.

Let's call file newUsers

next create a script with this info in it:

Code:
#!/bin/bash

for i in `cat newUsers`
do
useradd $i
done
You could add more to script as well - like if you'd like to set passwords just add passwd $i on line below useradd $i.

As of right now I personally do not know of a utility --
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Adding a new user to Solaris 9 so that this user can ssh into the server rcforster Solaris / OpenSolaris 2 03-14-2011 06:10 AM
Trouble adding user/psswd to Samba for Linux - XP sharing BigOil Linux - Networking 6 04-02-2008 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration