Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Private Group not created in linux

Status
Not open for further replies.

siddapur

IS-IT--Management
Jul 27, 2003
17
IN
Dear All, When I try to add a user I used to get user: group 100 does not exist error. So I created a group with group id 100. After that when ever I try to add a new user it is not creating User Private Group in that users name. By default it is taking group id 100 as primary group. How can I make it create a new User Private Group and take that group as new users primary group when ever I add a new user using useradd command.

thanks and regards
Sadguru
 
It sounds a little curious - a private group, where only one user is in.
Is this a group?

Ok - there might be reasons, to have such groups.
Of course useradd wasn't created with such recommendations in mind.

Therefore I would create a script 'privateUseradd', which creates a new group, and then calls useradd with that group.
If the expected number of maximum users is known, you could reserve a scope of numbers for GID and UID and make them match - for 300 users 2000-3000, for 30 users 2100-2200 i.e..
You could save the 'lastGID' and create the next GID as lastGID+1.

If I understood correctly.

seeking a job as java-programmer in Berlin:
 
Redhat useradd behaves like that by default, creating a new group for every new user.
 
RH does this for security reasons... i guess it just adds another layer of user/group level control.

a script would be the best way of doing this. simple bash script would only take a handful of lines.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top