Cannot add user to group properly on Linux

I`m trying to install boinc and therefore have to add my user fabian to the group boinc so I can read the file /var/lib/boinc/gui_rpc_auth.cfg . I ran

sudo usermod -a -G boinc $(whoami)

but after that, running

[fabian@desktop boinc]$ groups
audio fabian

still didn`t list the boinc group. However

[fabian@desktop boinc]$ getent group | grep boinc
boinc:x:1001:fabian

seems to indicate I`m in the group?!

In fact, I cannot open /var/lib/boinc/gui_rpc_auth.cfg which belongs to the group boinc and has permissions 640.

What am I doing wrong here?


Solution 1:

Short answer: One need to logout and relogin before the group assignment is effective.

Longer answer: Though the short answer is true in order to make the group change effective globally, one can still launch a new shell to use the new group temporarily — see this post for more detail.