Re: /etc/group changes don't take effect immediately
On Thu, Oct 02, 2003 at 05:21:47PM +0300, Alphonse Ogulla wrote:
> How does one explain this?
> Is the file /etc/group cached somewhere and updated
> only so often?
at login and at "set user id" and at "set group id" time.
> How can the changes be forced to take effect immediately
> without exiting and logging in again?
you can force it with the sg command:
charlie bin disk cdrom floppy audio irc src video staff games
marvin:/home/charlie# adduser charlie news
Adding user charlie to group news...
charlie@marvin:~$ sg news
news charlie bin disk cdrom floppy audio irc src video staff games
uid=1000(charlie) gid=9(news) groups=1000(charlie),2(bin),6(disk),24(cdrom),25(floppy),29(audio),39(irc),40(src),44(video),50(staff),60(games),9(news)
as you see my user wasn't part of the 'news' group, on another shell
i added it as root, and again in my original shell (without logout) with
sg I could force the information-update.
ps: up to now I did not know the sg command, just began to read couple
of manpages, like those of group,login,passwd,bash ... so read the fine
Végh Károly - System Engineer - UTA - TIS.SAS.BSS
Don't worry. Everything is getting nicely out of control.