I want to add my user patrick to the plex group, so I used the command

usermod -a -G plex patrick

Great! When I type groups patrick I get

patrick : patrick adm cdrom sudo dip plugdev lxd sambashare lpadmin plex

However, when I then tried to chgrp a directory from patrick to plex it returns a permission denied! If I type in groups with no username specified, the output returns

patrick adm cdrom sudo dip plugdev lxd sambashare lpadmin

with no group plex at the end. (And I'm logged in as user patrick)

What did I do incorrectly? Why am I seeing different results for groups vs groups username?


It's in the man page (man groups):


       Print  group  memberships  for  each  USERNAME  or,  if  no USERNAME is
       specified, for the current process (which  may  differ  if  the  groups
       database has changed).

Group membership is set at process creation time (login time). SInce you were not a member of the plex group when you logged in, groups doesn't list it as part of the current process. groups patrick consults the (updated with plex group membership) groups database.

To use the plex group membership, create a new process by logging out and in, or by executing the bash newgrp plex command.

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.