I added a group called developers
sudo groupadd developers
then added myself to that group
$ sudo usermod -a -G developers nick.weavers
Then I issued the command groups to check I'd been added, but got this
$ groups
nick.weavers wheel
However, if I issued the groups command with the name of the user I wanted to check like this
$ groups nick.weavers
nick.weavers : nick.weavers wheel developers
I am show to be in the developers group, but am I? Why do the two commands show different results?
From the groups man page (CentOS 7):
Adding yourself to a group does not affect the groups for processes already running, like your existing shell. This means you need to establish a new connection to see and use the permissions of the new group.