Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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. :-)

share|improve this answer
    
Great! Thanks for your help. –  André Oct 5 '11 at 10:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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