Operating System - HP-UX
1834804 Members
2951 Online
110070 Solutions
New Discussion

Re: HP UX Secondary Group?

 
Kesmond
New Member

HP UX Secondary Group?

Hi, i have assign one user called test1 and assign him group1 as the primary group and another user called test2 and assign him group2 as the primary group.

The file generated out from test1 belongs to group1 but test2 account need to access. So i give test2 account group1 as the secondary group. But however test2 is still unable to access. May i know what is the problem? Is this how secondary group works? thanks
9 REPLIES 9
Rodney Hills
Honored Contributor

Re: HP UX Secondary Group?

You need to do link /etc/logingroup to /etc/group (see man logingroup).

ln -f /etc/group /etc/logingroup

Then HPUX will use the secondary groups.

HTH

-- Rod Hills
There be dragons...
pabel
Valued Contributor

Re: HP UX Secondary Group?

Hi, have you check file permissions? You need to allow read/write/exec permissions to group users.

File permissions may look like this:

rwx rw- ---

Regards.
Kesmond
New Member

Re: HP UX Secondary Group?

the access rights is okay. i give it a 640.. so it should be able to read.

But the problem is the secondary group

Re: HP UX Secondary Group?

Hi,

How you added test2 account in group file. Please try the following command :

useradd -G group login

This may help you

- Vivek
melvyn burnard
Honored Contributor

Re: HP UX Secondary Group?

Try using the newgrp command to switch to group1 when logged in as user2:
newgrp group1

also
man newgrp
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Kesmond
New Member

Re: HP UX Secondary Group?

I have already added test2 to group1 as the secondary group using SAM, so must i do it in the command way to add it in the group directory?

By the way, what does the secondary group does? thanks
Ninad_1
Honored Contributor

Re: HP UX Secondary Group?

No. If you have added test2 to group1 through SAM , essentially SAM has used the command to add the user to the requested group.
But just to verify once you are logged in as user2 do a
groups
or if you are logged in as root do
groups user2
or grep group2 /etc/group - to check if entry for test2 appears.

Yes secondary group works exactly as you have thought.
What is the function of secondary group - Basically a particular user may have different roles and hence require different privileges. Hence he can be member of different groups as different permissions may be available by providing them to the additional groups.
I think I have used similar thing and did not require to do a newgrp to be able to get the access/privilege to read the file.
But still if you can see that test2 has been indeed a member of group1, try using newgrp group1 after logging in as user2 and try accesing the file.

Regards,
Ninad
KUMAR_13
Advisor

Re: HP UX Secondary Group?

Initiallly


test1:x:group1:
test2:x:group2:

Now u want test2 to be in group1: do following thing:
Login as root user,
usermod -G group1 test2

After that check
#su - test2
$cd /home/test1
$
if u able to go ..
There u are..
Cheers
If not .. Get back to me errors.

THX

V. Nyga
Honored Contributor

Re: HP UX Secondary Group?

Hi,

have you tested what Rodney said?

Volkmar
*** Say 'Thanks' with Kudos ***