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!

useradd & group question 1

Status
Not open for further replies.

gallows

Technical User
Jun 12, 2004
223
US
Running Solaris 9.

Is useradd supposed to add a user to /etc/group when creating a new account? I'm using the -g option and the account gets created but nothing is added in the group file.

I know I can manually edit the file to add users to groups but I could have sworn that in earlier versions of Solaris, that the users would be added automatically.

Zeek
 
dr72:x:72:101:John Doe:/home/dr72:/bin/bash

in the above entry in the passwd file, this user will be part of the group called testgroup (101). you will NOT see the user name in the /etc/group next to that group because it is dr72's primary group. IF you wanted to add dr72 to an additional (secondary) group, then you add that username in the /etc/group as seen in 'testgroup2'

Note in useradd
-g is for primary group
-G is to add a secondary group


/etc/group
testgroup::101:

testgroup2::102:dr72
 
Thanks dir111. I always thought that if you were not in the group file that you were not part of the group. We have an application that wasn't working because this. After manually adding the username to the group file, everything was ok. The group was in the passwd file as the primary.

Guess that was due to the poor design of the application as opposed to Solaris.

Gallows
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top