1821204 Members
3485 Online
109631 Solutions
New Discussion юеВ

Re: SAM question

 
Jeffrey F. Goldsmith
Super Advisor

SAM question

I was wondering why every time I create a user with SAM that they never show up in the /etc/group file. When I look at the groups from within SAM I see the users that were created and they all have a star next to their names. When I vi the /etc/group file and manually add the users, because they aren't there, the star next to their names goes away.

I have been dealing with this problem for several years now and would like to know if there was a way to fix it.

rp3440-4 w/HP-UX 11.i23

Thanks for the help
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: SAM question

Hi Jeffrey:

This has been the case since 11.0. There is no need to add the primary group of the user.

In 10.20 and prior, it was common to see LINE_MAX exceeded for the 'users' group, for instance, because every user was recorded in '/etc/group' as a member of the 'users' group.

See the man pages for 'group(4)' for more information.

Regards!

...JRF...
Jeffrey F. Goldsmith
Super Advisor

Re: SAM question

So, when I create a new user and they need to be in 3 groups I should create the user and then put them into the needed groups. Why doesn't the /etc/group file get updated with the user when I put them into that group?

If the user group isnt neccessary why is there?
Raj D.
Honored Contributor

Re: SAM question

Hi Jeffry ,

When you create a user either from SAM or useradd , the primary group membership group will not show in /etc/group file. But the supplimental group membership will show in /etc/group file.

for ex: if you created a user abc from sam , by default it will take group: users .

But abc user will not be listed in /etc/group , as its abc users primary group.

To see the primary group , use id command.
# id abc

To add supplimentarty group , you can use usermod with -G option.

Ex: # usermod -G sys abc
(It will ass sys group to the abc user , and will be visible in /etc/group ).


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: SAM question

Hi Jeffry ,

When you create a user either from SAM or useradd , the primary group membership group will not show in /etc/group file. But the supplimental group membership will show in /etc/group file.

for ex: if you created a user abc from sam , by default it will take group: users .

But abc user will not be listed in /etc/group , as its abc users primary group.

To see the primary group , use id command.
# id abc

To add supplimentarty group , you can use usermod with -G option.

Ex: # usermod -G sys abc
(It will add sys group to the abc user , and will be visible in /etc/group ).


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Steven E. Protter
Exalted Contributor

Re: SAM question

Jeffery,

If you add the user to existing groups the groups group numbers probably get listed in the /etc/passwd file. Not sure with 11.23 have not box handy.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: SAM question

Hi (again) Jeffrey:

Have a look at the manpages for 'group(4)' regarding the '/etc/logingroup' in particular.

Look too, at the manpages for 'groups(1)' to see how to list groups.

Regards!

...JRF...
Jeffrey F. Goldsmith
Super Advisor

Re: SAM question

I checked out all the group man pages and then ran a couple tests of my own. When I create a new user the default group is users. After they are created I can go into groups and add them into the groups that they need to be in. I am cool with that.

The second test was that when I created a new user I changed the group they were to be a member of. After the user was created I checked on them to make sure that they were in the correct group. They were in the group but there was a star at the end of their name and when I checked the /etc/group file they weren't listed as a member of that group. Once I added them to the group and saved the file and went back into SAM and looked the star was gone and they showed up in the group.

From now when we add a user via SAM we will let them go into the default users group and then add them to the groups that they need to be in.

Is that the way you see it?
Raj D.
Honored Contributor

Re: SAM question

Jeffrey ,

Also you can check for 'login' comamnd ,

# man login

The default data is: login, user ID,
primary group name, primary group ID, and /etc/passwd comment field
value. Output is sort by user ID, with user logins following system
logins.

hth,
Raj
" If u think u can , If u think u cannot , - You are always Right . "