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
Solved

how to create users with different id in linux

Posted on 2011-03-15
6
209 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
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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 
LVL 77

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 77

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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
winscp where are logs stored 3 51
ignore other .htaccess 2 58
Apache module 5 43
parallel rsync issues with Ubuntu 1 22
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

808 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