Solved

how to create users with different id in linux

Posted on 2011-03-15
6
214 Views
Last Modified: 2012-05-11
Dear Experts:

I have centos linux iam looking for how to create a new users (50 users) with userid and gid to start from 6000. Iam aware of usermod but iam looking for new users, similarly want to create additional groups  new groups like QA , PRODUCTION ,QC, like this many more groups .Please help.
0
Comment
Question by:D_wathi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 23

Expert Comment

by:savone
ID: 35143577
You can specify the uid when creating the user like this

useradd -u 6000 newuser

0
 
LVL 23

Accepted Solution

by:
savone earned 167 total points
ID: 35143583
You can do the same for guid with -g

Like so

useradd -u 6000 -g 6000 newuser

For more info Google "man useradd"
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 166 total points
ID: 35143640
for i in {6000..6050}
do
    useradd -u $i -g 6000 user$i
    echo "password" | passwd --stdin user$i
done
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 78

Expert Comment

by:arnold
ID: 35144488
to set a password on a linux is possible using usermod -p <encrypted_password> username
0
 

Author Comment

by:D_wathi
ID: 35146549
thanks for all. when tried with  useradd -u 6000 -g 6000 newuser  but not  working out. Please help.
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 167 total points
ID: 35147384
what is not working out? You need to provide details as well as a couple of your attempts

the -g needs a group name rather than a numeric.
if you want the group to also have a 6000+ gid you would first use the groupadd -g 6000 newgroup
useradd -u 6000 -g newgroup newuser

id newuser?

Any reason you are not using the common users group for the users?  If some users need to be members of another group you can set that using the -G additionalgroup, additionalgroup2
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
The better OS Architecture 13 108
Check for Linux process in script 7 88
phpmyadmin memory error 55 92
RHEL 6.0 - Does it support SHA2? 7 39
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question