Bill Jonas on Wed, 2 May 2001 12:02:20 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] LPIC: User groups in Linux


On Wed, May 02, 2001 at 06:25:59AM -0400, Rupert Heesom wrote:
> What is the "egid"?  Do you mean "GUID"?

You have the concept of UID and GID; these you already know.  There's also
EGID and EUID, which are the "effective" GID and "effective" UID.
Normally, these are the same except for some special (but not unusual)
circumstances, such as running a SUID or SGID binary.  Example:

bj@neo:~$ ls -l /usr/bin/passwd
-rws--x--x   1 root     bin         35620 Jun 18  2000 /usr/bin/passwd

When you run passwd, the EUID of that process becomes root (obviously,
it's SUID because you don't want anybody except root writing to
/etc/passwd and /etc/shadow, and reading from /etc/shadow), but your
"real" UID is still whatever your actual UID is (say, 500 or 1000).  Your
GID does not do anything because this is set UID and not set GID.

Also, I must've misunderstood Gabriel's statement; I think you have to
actually log out and log back in (or run a process with root privileges to
give you the higher privileges, such as 'su - youruser') in order to take
advantage of any change to /etc/group:

bj@neo:~/tmp$ touch test
bj@neo:~/tmp$ ls -l
total 0
-rw-r--r--   1 bj       users           0 May  2 11:41 test
bj@neo:~/tmp$ chgrp adm test
chgrp: you are not a member of group `adm': Operation not permitted
bj@neo:~/tmp$ id
uid=1000(bj) gid=100(users) groups=100(users),14(uucp),70(audio),75(src)
bj@neo:~/tmp$ grep 'adm.*bj' /etc/group
adm::4:root,adm,daemon,bj
bj@neo:~/tmp$

-- 
Bill Jonas    *    bill@billjonas.com    *    http://www.billjonas.com/
"As we enjoy great advantages from the inventions of others,  we should
be glad of an opportunity to serve others by any invention of ours; and
this we should do freely and generously."          -- Benjamin Franklin


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug