?
Solved

how to create users with different id in linux

Posted on 2011-03-15
6
Medium Priority
?
219 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 668 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 664 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 79

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 79

Assisted Solution

by:arnold
arnold earned 668 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

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

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

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month8 days, 16 hours left to enroll

764 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