Re: /etc/group changes don't take effect immediately
Alphonse Ogulla <email@example.com> writes:
> Hi all,
> In an effort to run ppp as non root, I had to include my normal user
> id in the
> group 'dip' by directly editing /etc/group using vi.
You don't need to do that.
$ adduser yourusername dip
should do that for you.
> However, on saving and
> exiting /etc/group, I still could *not* access files owned by user root and
> available to users in group dip whilst using my normal uid. Just as I was
> about to give up, I decided to exit the shell and log in once again
> and to my
> amazement, I now could read files in /etc/ppp/peers directory whose
> permission is as follows:-
> user@fep:/etc/ppp$ ls -ld peers
> drwxr-s--- 2 root dip 4096 Oct 2 12:06 peers
> How does one explain this? Is the file /etc/group cached somewhere and
> only so often? How can the changes be forced to take effect immediately
> without exiting and logging in again?
This is the normal behaviour. You have to log out and log in again (even
using adduser) for the change to take place.
[I might be wrong in the following:]
I believe that /etc/group and /etc/passwd are only read at login time,
therefore changes to these files will only take place at next login. If
you were running in X, you should completelly log out of your session,
and log in again. You could try however to login as yourself again in
an existing terminal
$ su - yourusername
then this (and only this) new session might have the privileges of the
new group (but I might be completelly wrong here).
Please answer to the group/list. Don't CC me.