command line question

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 SIGNED MESSAGE-----
Hash: SHA1

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/

iQIcBAEBAgAGBQJMSbnCAAoJEF+XTK08PnB53s4P/RsLoRWZMZM91QBovayA53OB
3yeNzfWjbSD1SKKc55rWjxqX/J8gsVMApu2QVtoFRfClFDSzHUDwknCFb2RRMO07
7rfdwJG2dcZWrW5iVNNVjchsckzKjCZ6PaO2R9pcvvFPmT//PSeXNHf3yytd+WRc
fVL98RNtsbHWVpzcdT5DhH1MPiEdPhP1uwM71mDCxgtwOyRl4lDoHaB2muux9AtG
c0Xlw8ycyZ2/FPyrObaDnRT3tG+ABVpb1cUS73bLwuJcUs0usgR7rNw6Ir/HlKOE
EWsTXjJnEYKo38WEgiMeB5b/utEYDdbpyKxJb7mpQApdJShRBYhsprjy52hEWW5x
2CDiLn24yRbtHydtZWQnCQ/AE+2L2OSiLqOhuFHaK8Nlvv1EJagxaF/Oso75hm1B
Z5UJB75deF3+LTD8geTcz7hTl5VsXCKnmw2XHv19wQk2oIPZ/4q5Y5tSnv23aqX1
eY0IiRhb2VzY5RvdOo32admD08tgSTUAknC1M2KGxH2yhnwiTA07ZwE8Gu90dinv
0XjMXq1hFD+p3KTsz3aG0XtU6dE10SXwFZiUhKLukrAGQxvmOWUf/SW3qmP3JL2s
N5w7EkhnB6nhyPuBJ3dxjrHbXreMIfU1jADlN/wgjaesdiAHeaCQqQDYG8i11C05
UaF1E4w0a3kl7/EBJ/Gz
=Iv5f
-----END PGP SIGNATURE-----

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)…


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

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.

Logging out and back in fixed this.

Dave