Incompatible group permissions in Linux - Is it a bug?

Possible Duplicate: ¢ How to apply changes of newly added user groups without needing to reboot?

I get on Ubuntu 11.04. I am developing an additional customer and also positioning an existing customer in the group of various other customer, wanting to write in the residence directory site of various other customer.

# uname -a
Linux vini 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC
2011 i686 athlon i386 GNU/Linux
# whoami
sachin
# su root
# useradd -m -U foo               // create user foo
# usermod -a -G foo sachin      // add user `sachin' to group `foo'
# chmod 770 /home/foo/
# exit
# whoami
sachin
# cd /home/foo/
bash: cd: /home/foo/: Permission denied
# groups sachin
sachin : sachin foo

This is entirely unusual. Though customer sachin remains in group foo, and also group little bits for/ home/foo/ is readied to rwx, sachin can not chdir to/ home/foo/. I am unable to recognize this.

Yet, if at the exit action, I switch over to sachin customer from origin, this is what takes place:

# uname -a
Linux vini 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC
2011 i686 athlon i386 GNU/Linux
# whoami
sachin
# su root
# useradd -m -U foo               // create user foo
# usermod -a -G foo sachin      // add user `sachin' to group `foo'
# chmod 770 /home/foo/
# su sachin
# whoami
sachin
# cd /home/foo/
# ls
examples.desktop

Now, whatever is taking place below is entirely incomprehensible. Does su sachin acquires some permissions from the origin customer at this action?

A remedy that was recommended was to make use of newgrp, which updates the group and also various other customer details. So if I do newgrp - sachin, after that I get accessibility to the directory site of the freshly developed customer, yet if I create another customer and also adhere to the very same actions sachin does not get accessibility to the most up to date users directory site.

This actions is without a doubt really complicated.

Any kind of descriptions would certainly be much valued.

0
2022-06-07 14:30:51
Source Share
Answers: 1

Your existing login shell procedure maintains the group arrangement it had in the past. Specifically, contrast the result of

groups sachin

with

groups

. After logout and also login, the distinction is gone.

If you can not relogin as a result of factors vague to me, you need to waterfall the newgrp things. Imnternally, newgrp not does anything yet "relogging in" in a new layer of procedures. If you log out, you need to push Ctrl - D as usually as you have newgrp things running.

Conversely, you end the internal newgrplayer and also start an additional one after a usermod. After that you once more have accessibility to the existing set of teams.

4
2022-06-07 16:10:44
Source