Add user to group but not reflected when run "id"

Did you log the "matt" account out and back in after running the sudo usermod command? Changes to the groups a user is in under unix only take affect at login time.


https://superuser.com/questions/272061/reload-a-linux-users-group-assignments-without-logging-out

check that out ~

both

newgrp groupname

OR

su - username

will do the trick well ~


In answer to your side question, yes you can add a user to a group without listing them all. If you run a Debian based system, you can do it with

sudo adduser matt staff

The adduser utility is just a friendly wrapper around useradd/usermod etc.

If you don't have the adduser utility, you can still do it with usermod:

sudo usermod -a -G staff matt

The -a flag means append (as opposed to overwrite).

Tags:

Linux

Unix