LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-08-2021, 08:43 PM   #1
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
Groups listed with 'id' are different


I added myself (myuser) to the vboxusers group, and my /etc/groups file shows my user as a member of the vboxusers group.
Code:
vboxusers:x:135:myuser
When I execute the following as myuser:

Code:
$ id myuser
uid=1000(myuser) gid=1000(myuser) groups=1000(myuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),114(lpadmin),134(sambashare),135(vboxusers)

$ id
uid=1000(myuser) gid=1000(myuser) groups=1000(myuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),114(lpadmin),134(sambashare)
Why does the first show vboxusers, and the other one not?
 
Old 06-08-2021, 08:54 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
I’m guessing that the second is because the current session doesn’t know about the change.
Couple of ways to confirm that:
1) logout and log back in
2) to preserve the current session, su myuser, enter password to login.

Rerun the id command.

Please let us (me ) know if my guess is right or not.
 
Old 06-09-2021, 07:55 PM   #3
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Original Poster
Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by scasey View Post
Please let us (me ) know if my guess is right or not.
Multi-tiered answer ...
I ran 'su myuser', and the results were updated.

I tried logging out and back into the gui, and got the original results. I had to restart the computer, after which the results were updated.

So, you were right in that it was a user context issue. But for some reason, I had to restart the pc to permanently fix.
 
Old 06-09-2021, 08:36 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Hmmm.
I meant log out and back into the terminal, although I suppose that logging out of the GUI would end any terminal sessions.
The su myuser worked, but of course if you exit from that, you’d be back in the shell that was “ignorant” of the change.
You don’t say how you added the user to the group, but if you did it in a subshell, or with a GUI or something like webmin, then the already-running shell wouldn’t know about the change

The only time I feel a need to reboot is following a kernel update…
 
Old 06-10-2021, 06:08 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
Quote:
Originally Posted by SlowCoder View Post
I tried logging out and back into the gui, and got the original results. I had to restart the computer, after which the results were updated.
That shouldn't have been necessary, but maybe it's a peculiarity of your DISPLAY MANAGER or systemd.logind or similar. On my old-school non-systemd rig using XDM, a logout/in is all that is needed for the new credentials to take effect.
 
Old 06-11-2021, 12:35 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I can confirm that only a user logout/in is necessary for that to take effect.
Nota bene: a user logout (sometimes a graphical session can be terminated, bringing you back to the command line, but without logging the user out).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ValueError: Entry points must be listed in groups (Python compilation error) Bindestreck Slackware 3 08-02-2016 07:16 AM
How to restrict web accessing to different groups for different sites in squid 2.6 singh_chitranjan Linux - Server 1 05-19-2010 03:03 AM
motd and setting up different shells to different user groups torrent55 Debian 4 11-03-2008 04:53 PM
Securing files: Different permissions for different groups BigChuckP Linux - Security 6 05-05-2006 08:55 AM
Listed partition in cfdisk, but not listed in /dev? Erik_the_Red Linux - Newbie 7 08-05-2005 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration