Operating System - HP-UX
1834133 Members
2100 Online
110064 Solutions
New Discussion

Unable to add more groups for one user

 
SOLVED
Go to solution
Tom Spence_1
Regular Advisor

Unable to add more groups for one user

Hi, I am using 10.20 HPUX and can't add more group membership for user.

Here what I did:

Run SAM
- Accounts for Users and Groups
- Users
- [select user (tspence)]
- Menu -> Actions -> Modify Group Membership...
- added 4 groups (staff,ddrs,ddds)
- all exit

# id tspence
uid=316(tspence) gid=204(staff) groups=3(sys)

groups said sys? Where is other groups??? Any idea?

Thanks for your help...
Thinking Snow!
18 REPLIES 18
Christopher McCray_1
Honored Contributor
Solution

Re: Unable to add more groups for one user

Hello,

What is the output of:

# groups tspence


Chris
It wasn't me!!!!
Tom Geudens
Honored Contributor

Re: Unable to add more groups for one user

Hi,
Can you check if you actually added the user to the groups ?
grep "ddrs" /etc/group
grep "ddds" /etc/group
...
Is tspence actually in them ?

Regards,
Tom
A life ? Cool ! Where can I download one of those from ?
Christopher McCray_1
Honored Contributor

Re: Unable to add more groups for one user

check for the link /etc/logingroup pointing to /etc/group... is it there?


what does your /etc/group look like?

Chris
It wasn't me!!!!
F Verschuren
Esteemed Contributor

Re: Unable to add more groups for one user

How many groeps do you have on the system?
please run a
pwck
and
grpck
to veryfy if all groeps are corectly.
if this doen't work
please atacht the group file and the passwd file for a closer look.
Nick Wickens
Respected Contributor

Re: Unable to add more groups for one user

There is a man page for logingroup which may help.
Hats ? We don't need no stinkin' hats !!
Tom Spence_1
Regular Advisor

Re: Unable to add more groups for one user

Hello,

What is the output of:

# groups tspence

Chris

----------------------------
Wow fast respond!

Ok the output:
#groups tspence
ddds ddrs staff sys

Thanks. BUT I can't access one file like this:

drxwrxw--- dspence ddrs ... [filename]

How can I read the file even though I am ddrs group? Any idea?
Thinking Snow!
Hai Nguyen_1
Honored Contributor

Re: Unable to add more groups for one user

What is the output of this command?
# id -nG tspence

Does it list all the groups you added for this user?

Hai
Tom Spence_1
Regular Advisor

Re: Unable to add more groups for one user

What is the output of this command?
# id -nG tspence

Does it list all the groups you added for this user?

Hai
---------------------
output:
#id -nG tspence
staff sys

3 miss groups? Any idea?
Thinking Snow!
Christopher McCray_1
Honored Contributor

Re: Unable to add more groups for one user

Hello,

Have you logged out and logged back in (assuming you added these groups while logged in)?

What did this do?

Chris
It wasn't me!!!!
Hai Nguyen_1
Honored Contributor

Re: Unable to add more groups for one user

Thomas,

...
Thanks. BUT I can't access one file like this:

drxwrxw--- dspence ddrs ... [filename]
...

In order to access the file,
you need to do this:

# newgrp ddrs
# do your work here
# newgrp

The last command will bring you back to your default group.

Hai
Tom Spence_1
Regular Advisor

Re: Unable to add more groups for one user

Hello,

Have you logged out and logged back in (assuming you added these groups while logged in)?

What did this do?

Chris
-----------------------------
I just login as root first before I log in my account.

$ groups tspence
ddds ddrs staff sys
$ id tspence
uid=316(tspence) gid=204(staff)

Is that strange? No ddds, ddrs, and sys. Also I don't see any /etc/logingroup.... Do I need to have /etc/logingroup? I don't use NIS...

-Tom
Thinking Snow!
Christopher McCray_1
Honored Contributor

Re: Unable to add more groups for one user

Hello again.

Yes, you definately need this

# ln -s /etc/logingroup /etc/group

you should see:

dmc03:/etc# ll login*
lrwxrwxrwx 1 root root 10 Jul 7 1998 logingroup -> /etc/gro
up
Read the man pages on logingroup

Hope this helps

Chris
It wasn't me!!!!
Tom Spence_1
Regular Advisor

Re: Unable to add more groups for one user

Hello again.

Yes, you definately need this

# ln -s /etc/logingroup /etc/group

you should see:

dmc03:/etc# ll login*
lrwxrwxrwx 1 root root 10 Jul 7 1998 logingroup -> /etc/gro
up
Read the man pages on logingroup

Hope this helps

Chris
----------------------------
Ahh, I see but after I made ln but error...

#ln -s /etc/logingroup /etc/group
ln: /etc/group exists

You mean:
#ln -s /etc/group /etc/logingroup?
Thinking Snow!
Christopher McCray_1
Honored Contributor

Re: Unable to add more groups for one user

Yes,

This is what happens when you sleep upside-down all night.

Chris
It wasn't me!!!!
Tom Spence_1
Regular Advisor

Re: Unable to add more groups for one user

MILLION THANKS TO EVERYONE!!! It works GGGRRREEEAAATTT!!!

I appreciate it!!!

-Tom
Thinking Snow!
Bill Hassell
Honored Contributor

Re: Unable to add more groups for one user

Just a note to explain what is happening:

/etc/logingroup (for the old 10.20 and earlier opsystems) defines the multi-membership groups and users. If it does not exist, users must use the newgrp command (a pain but works fine). By linking logingroup to group, then all multiple group memberships in group will be activated.

NOTE: do not copy group to logingroup since any changes made to group will not be reflected in logingroup.


Bill Hassell, sysadmin
Tom Spence_1
Regular Advisor

Re: Unable to add more groups for one user

Ok, let me clarify..

Should I?

1) #ln -s /etc/logingroup /etc/group

OR

2) #ln -s /etc/group /etc/logingroup

I picked #2, if I am wrong then I'll remove logingroup then how can I make new logingroup? Once you said 'can't copy group to logingroup'. I tried 'newgrp' command but no new file 'logingroup'? Any idea?
Thinking Snow!
Christopher McCray_1
Honored Contributor

Re: Unable to add more groups for one user

You chose correctly.

If you do an ll on /etc/logingroup, you should see the output I posted previously. As Bill said, This link removes the need to execute the newgrp command. Also, by having the link instead of copying /etc/group into /etc/logingroup, any changes made to /etc/group is reflected in /etc/logingroup. Copying will not reflect any changes until another copy is made.

In short, If you have the link now, you are fine.

Chris
It wasn't me!!!!