LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2021, 12:51 PM   #1
kazesyxers
LQ Newbie
 
Registered: Nov 2021
Posts: 4

Rep: Reputation: Disabled
Clarification for output of id command


Hello people,

I'm trying to understand id command used to display details about users. When i simply type id i got below result
uid=1000(kaze) gid=1000(kaze) groups=1000(kaze),27(sudo)

But when using command id kaze, i got below output
uid=1000(kaze) gid=1000(kaze) groups=1000(kaze),27(sudo),33(www-data)

Please note that i previously did below command and i a connected as kaze user
sudo usermod -a -G www-data kaze

Can somebody, please explain why i do not have the same result with both id commands, knowing that i am connected with kaze user?
 
Old 11-04-2021, 01:03 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 6,257
Blog Entries: 3

Rep: Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228Reputation: 3228
The changes to group membership only take effect after you've logged in anew. So my guess is that id by itself is not reading from /etc/group but instead from the current login session and that you've made the change but not logged out and back in again, at least in the one window.

By the way, there's usually no reason for any normal account to be a member of the group www-data. That group exists only to accompany the account www-data. That account exists only for the purpose of providing a separate, unprivileged account for the web daemon to run under. That is for the purposes of both Privilege Separation and Least Privilege. So, short of extenuating circumstances, you should remove your account from that group. What problem were you trying to solve?
 
1 members found this post helpful.
Old 11-04-2021, 01:15 PM   #3
kazesyxers
LQ Newbie
 
Registered: Nov 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you so much for your feedback. I logged out and logged in again and i now have the same output to both commands!

I was no trying to solve a special problem, just playing around to understand user and group management on my box.

Thank you again!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
clarification w/r/t directing sudo output to flash drive frankfenderbender Linux - General 5 11-03-2019 06:13 AM
need clarification on the command ls -dF anon132 Linux - Newbie 6 09-11-2017 11:20 PM
cURL command clarification dumblinuxuser Linux - Newbie 6 08-09-2016 09:42 PM
Wrote Shell in C - piping output from first command to second command, sending to output file issue KarenWest Programming 2 03-31-2016 05:27 PM
clarification on find + xargs rm command dtra Linux - General 2 05-17-2006 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:34 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