3

I added a new group (call it newgroup)

sudo groupadd newgroup

I then added my existing user (call him myuser) to newgroup

sudo usermod -a -G newgroup myuser

I log out and back in, and I check /etc/groups

$ less /etc/group | grep newgroup
newgroup:x:1001:myuser

So far, so good. However, I also have a new directory (call it newdir) with permissions drwxrwsr-x owner is root and group is newgroup. When I try to create a file in newdir as myuser, I get permission denied.

So I do an id check

$ id
uid=1000(myuser) gid=1000(myuser) groups=1000(myuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),131(libvirt)

I'm not a part of newgroup. I also try groups just to be sure

$ groups
myuser adm cdrom sudo dip plugdev lpadmin sambashare libvirt

So what did I do wrong? Why is myuser a member of newgroup according to /etc/group but not anywhere else in the system?

Edit: The question linked to by muru referred to users that had not been logged out and logged back in. Therefore, rebooting resolved the problem. Coincidentally, rebooting solved my problem as well, but I was under the impression that logging a user out and back in would complete new group assignements.

4

1 Answer 1

4

Restarting solved the problem. I logged out and back in twice (the second time just to be sure I hadn't screwed something up somehow), but it seems to take a reboot for the new group association to take effect.

Sorry for the wild goose chase everyone. Is this something particular to Ubuntu (or Ubuntu Mate or 18.04)? I don't seem to remember having to fully reboot to associate users with groups before. I thought you just had to log out and back in if the user you were assigning was currently logged in.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .