I have come across something in using bash that really surprises me. I am hoping someone can explain why this is happening. It is not a problem since I know how to get around it, but I would like to understand it.
It goes like this:
open a new terminal window
verify who I am
display groups. Note that one group is missing from the list
switch users to myself
display groups. Note that all groups show now.
I noticed this because I could not access a directory that I should have had access to based on group membership.
Snippet from terminal window is below. Notice that svn_group does not show up until i switch users even though I seem to be switching users to the same user as was previously running:
dmiller@linux-home-11-2:~> whoami
dmiller
dmiller@linux-home-11-2:~> groups
users dialout video
dmiller@linux-home-11-2:~> groups dmiller
dmiller : users dialout video svn_group
dmiller@linux-home-11-2:~> groups
users dialout video
dmiller@linux-home-11-2:~> su dmiller
Password:
dmiller@linux-home-11-2:~> whoami
dmiller
dmiller@linux-home-11-2:~> groups
users dialout video svn_group
dmiller@linux-home-11-2:~>
Did you just add that and have you logged out and back in since making the
change? Your current environment cannot be changed by the system
forcefully but when you load a new environment/shell then that should be
reflected properly.
Good luck.
On 07/23/2010 09:36 AM, az10sbum wrote:
>
> I have come across something in using bash that really surprises me. I
> am hoping someone can explain why this is happening. It is not a
> problem since I know how to get around it, but I would like to
> understand it.
>
> It goes like this:
> 1. open a new terminal window
> 2. verify who I am
> 3. display groups. Note that one group is missing from the list
> 4. switch users to myself
> 5. display groups. Note that all groups show now.
>
> I noticed this because I could not access a directory that I should
> have had access to based on group membership.
>
> Snippet from terminal window is below. Notice that svn_group does not
> show up until i switch users even though I seem to be switching users to
> the same user as was previously running:
>
> dmiller@linux-home-11-2:~> whoami
> dmiller
> dmiller@linux-home-11-2:~> groups
> users dialout video
> dmiller@linux-home-11-2:~> groups dmiller
> dmiller : users dialout video svn_group
> dmiller@linux-home-11-2:~> groups
> users dialout video
> dmiller@linux-home-11-2:~> su dmiller
> Password:
> dmiller@linux-home-11-2:~> whoami
> dmiller
> dmiller@linux-home-11-2:~> groups
> users dialout video svn_group
> dmiller@linux-home-11-2:~>
>
>
>
> Thanks
>
> Dave
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
az10sbum wrote:
> Notice that svn_group does not
> show up until i switch users even though I seem to be switching users to
> the same user as was previously running:
>
> dmiller@linux-home-11-2:~> whoami
> dmiller
> dmiller@linux-home-11-2:~> groups
> users dialout video
> dmiller@linux-home-11-2:~> groups dmiller
> dmiller : users dialout video svn_group
> dmiller@linux-home-11-2:~> groups
> users dialout video
> dmiller@linux-home-11-2:~> su dmiller
> Password:
> dmiller@linux-home-11-2:~> whoami
> dmiller
> dmiller@linux-home-11-2:~> groups
> users dialout video svn_group
> dmiller@linux-home-11-2:~>
>
here, following the same commands in the same order, i get the same
six groups each time
denver@linux103-32:~> whoami
denver
denver@linux103-32:~> groups
users bin floppy cdrom video vboxusers
denver@linux103-32:~> groups denver
users bin cdrom floppy vboxusers video
denver@linux103-32:~> groups
users bin floppy cdrom video vboxusers
denver@linux103-32:~> su denver
Password:
denver@linux103-32:~> whoami
denver
denver@linux103-32:~> groups
users bin floppy cdrom video vboxusers
i can only guess something is rotten in Denmark (or wherever you are)…
Thanks. That was it. I had not logged out since adding svn_group
I had opened a new terminal window since adding svn_group, but not logged out. Apparently the su command gets the new settings, but a new terminal window doesn’t.