Operating System - HP-UX
1834882 Members
2328 Online
110071 Solutions
New Discussion

Re: Unable to access files with SGID bit on.

 
Chern Jian Leaw
Regular Advisor

Unable to access files with SGID bit on.

HI,

I would like to access files/directories in which I have its group access. I'm a member of the group psc. However, I'm not the owner of those files/directories.

#cd /proj
#ls -l
drwxrws--- 7 ptm psc .... design_db
drwxrws--- 2 ptm psc .... debug_utils
drwxr-sr-x 6 ptm psc .... validation_tools

#cd design_db
design_db: Permission denied

#cd debug_utils
debug utils: Permission denied

#cd validation_tools
#ls -l
-rw-r-xr-x 2 ptm psc .... README

From the output above, I'm however able to access files/directories having permissions 755 or 555 i.e anything which has the universal access turned-on.

Seems like the system is still treating me like other users and not as member of the psc group.

I'm attempting to access these directories in a NIS domain which I do not have root access.

Is there any other method which I'm able to access these files? As a member of the psc group, I can't understand why I'm unable to access these directories.

Could any one help me out in this matter?

Thanks.


3 REPLIES 3
Michael Tully
Honored Contributor

Re: Unable to access files with SGID bit on.

The man page for 'chmod' will tell you that the mode for using ?rwx-rws is for files only.

2000 (= g=s) Set group ID on file execution (file only)

You best bet is to either change the mode to

drwxrwx (770) or drwxr-sr-x (2755) the same as your sub-directory 'validation_tools'
Anyone for a Mutiny ?
Bill Hassell
Honored Contributor

Re: Unable to access files with SGID bit on.

Is psc your primary group? If not, are you running 10.20? Type the command: id

It will show all the groups in which you are a member. If psc does not show up there, then you are not a member, despite what /etc/group says. Prior to 11.0, to be a member of multiple groups, you would have to be listed in /etc/logingroup as well. The workaround for 10.20 and earlier is to create a symlink from logingroup to group. Once in place, the id command will report your other group(s) anhd you will have group rights.


Bill Hassell, sysadmin
Chern Jian Leaw
Regular Advisor

Re: Unable to access files with SGID bit on.

Bill,

I have the /etc/logingroup symbolically linked to /etc/groups, since it's a HP 10.20.
However, the psc group which I'm a member of exists in the NIS master server, and it's NOT my primary group.

Do you mean to say I need to have the group psc in the /etc/logingroup? I already have it in the /var/yp/src/group file in the NIS master server.

The contents of my /etc/logingroup looks as follows:
nobody2:*:-2:
wheel:*mikej:0:ken_lee, asamuel, ... (my user name is not here)
sys:*:3:bin, ... (not in this group too)
adm:*:14:adm, steve
mail:*:6:root
nogroup:*:-2
+:*::

The group psc does not exists in the /etc/logingroup nor in the /etc/group file.

Are there any other alternatives to this problem besides one possibile solution from Michael Tully?

Thanks.