General
cancel
Showing results for 
Search instead for 
Did you mean: 

should I use setgid in this situation, or something else?

Hanry Zhou
Super Advisor

should I use setgid in this situation, or something else?

I have a number of files "xyz.1", xyz.2",... under the directory "dirname"

cd dirname(with permission of 775)
ls -l
-rw-rw---- david users xyz.1
-rw-rw---- david users xyz.2
...

now, I have another id called "john", and he belongs to group "grp-a", and "john" want to be able to read all these xyz.* files. What I should do to achive this?

I did chmod 2775 on dirname, but "john" still can't read all these xyz.* file.

Can 2775 to achive what I want, and what is the correct method to achive what I want.

Thanks,

none
3 REPLIES
Jeroen Peereboom
Honored Contributor

Re: should I use setgid in this situation, or something else?

L.S.

setgid is NOT what you want. Setgid is used for programs, such that if you execute the program your group is changed to that of the programfile.

Easiest solutions:
Add john to the users group?
Make the files world-readable (-rw-rw-r--)?

JP
Mark Grant
Honored Contributor

Re: should I use setgid in this situation, or something else?

Actually, if you add "john" to group users you won't need world readable permission on the files. Remember a user can be in more than one group. Have a look at /etc/group
Never preceed any demonstration with anything more predictive than "watch this"
Jeroen Peereboom
Honored Contributor

Re: should I use setgid in this situation, or something else?

Hanry,

Check this thread in the HP-UX forumr ???

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=603007

Now you have 2 competing threads and I feel like loosing time answering this one... :-)

JP