Solved

how to create users with different id in linux

Posted on 2011-03-15
6
199 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
6 Comments
 
LVL 23

Expert Comment

by:savone
Comment Utility
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
Comment Utility
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
Comment Utility
for i in {6000..6050}
do
    useradd -u $i -g 6000 user$i
    echo "password" | passwd --stdin user$i
done
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 76

Expert Comment

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

Author Comment

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

Assisted Solution

by:arnold
arnold earned 167 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now