For loop to add user accounts

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat For loop to add user accounts
# 1  
Old 11-20-2012
RedHat For loop to add user accounts

Hi i need to add 100 users on a redhat linux box . Can you guys help me .

useradd -u 123456 -g 400000 -G 4545 -c " abcdef " -m -d /home/abcd -s /bin/bash abcd
# 2  
Old 11-21-2012
Quote:
for i in {1..100}
do
useradd -u $i -g 400000 -G 4545 -c $i -m -d /home/$i -s /bin/bash $i
done
I think something like that...
Or you can make a list of names in txt file and read them into for loop.
This User Gave Thanks to jabalv For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. OS X (Apple)

Thunderbird user accounts

Hi All I am trying to find a way to set-up a thunderbird account by using a script, i have been trying to to add the lines into the pref.js file but it keeps getting overwritten any help would be great thanks Adam (0 Replies)
Discussion started by: ab52
0 Replies

2. Solaris

Solaris User Accounts

Hi, Can you please tell me how to know the number of user account limit in solrise 5 version.Is there any cmd to see how many max user acc can be created. Thanks in advance (2 Replies)
Discussion started by: kkalyan
2 Replies

3. Solaris

Help with user accounts

Hi All, How to know all the shells a user has access. Thank you . (0 Replies)
Discussion started by: rama krishna
0 Replies

4. UNIX for Dummies Questions & Answers

Difference between : Locked User Account & Disabled User Accounts in Linux ?

Thanks AVKlinux (3 Replies)
Discussion started by: avklinux
3 Replies

5. UNIX for Dummies Questions & Answers

single user mode - user accounts passwords

hello ppl, someone must be able to help with this --> I have an old NCR tower 32 with an ADDS terminal running a unix version 020102 (Im not sure if thats correct but its unix for sure). I have no user names and no passwords and need to login to read a tape. Is there any way to do that? I hear... (3 Replies)
Discussion started by: orestis
3 Replies

6. Shell Programming and Scripting

Loop through the accounts and servers

Hi everyone, I am trying to use loop (for loop but can be any loop) which will read from the file (text file) which will have 2 column one for account and another for server which kind of look like this account1 server1 account2 server2 account3 server1 account4 server1 5 server3 6 server2... (1 Reply)
Discussion started by: pareshan
1 Replies

7. UNIX for Dummies Questions & Answers

User Accounts

Hi, I was wondering if someone could tell me how to display a list of all existing user accounts on the system, not neccesarily looged in. Thanks in advance Stephen (3 Replies)
Discussion started by: sroberts82
3 Replies

8. UNIX for Dummies Questions & Answers

Help with user accounts

I have a root access to a UNIX system. I want to create another account with administrative permissions (create users, delete them, manage print and system configuration), how do I do that? I have a Solaris 9 (SunOS 5.9) installed. Please help. :o (3 Replies)
Discussion started by: neked
3 Replies

9. Shell Programming and Scripting

User Accounts

I have found a script to create user accounts. But there are a few lines i dont understand. Can someone help me with this? Here's the code: ###################################### while ; do ACCT=${USER_ACCT}${START} START=`expr $START + 1` START=`echo ${START} | awk... (3 Replies)
Discussion started by: Sensor
3 Replies
Login or Register to Ask a Question