2

I have some doubts with the use of the command id in Linux...

I have added one user(andre) to the group "github-total", do if I do id andre I got:

$ id andre
uid=500(andre) gid=500(andre) groups=500(andre),502(github-total) context=user_u:system_r:unconfined_t

But if I do only id:

$ id
uid=500(andre) gid=500(andre) groups=500(andre) context=user_u:system_r:unconfined_t

The thing is that the user "andre" is not assuming that he is in the group "github-total" when I run only id without argument. And in reality the user is not in the group.

So my question is... How can I add the user "andre" to the group "github-total"?

Best Regards,

Sorry my english.

7

The reason is that you made the change but haven't logged out / logged back in again.

When you run id with no arguments, it prints the data inherited from the parent shell, which established the group IDs after it consulted the databases after login.

When you run id with a username, it instantly queries the databases to see what that user's group id information is.

So... to directly answer your question, logout then log back in. :-)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.