Solved

how to create users with different id in linux

Posted on 2011-03-15
6
206 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
open source backup solution 1 29
ftp to port 21 4 43
awk to variable in bash 2 43
Web resource - Man pages for SUSE Enterprise Linux 11 1 26
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

777 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