10

I'm trying to add myself to the fuse user group but it doesn't look like the change is taking effect even though /etc/group looks correct after invoking addgroup or usermod.

I've tried both ...

sudo addgroup fjohnson fuse

and

sudo usermod -a -G fuse fjohnson

/etc/group shows the change

fuse:x:104:fjohnson

but I can't read

-rw-r----- 1 root fuse 215 Oct 16 10:39 /etc/fuse.conf

as

cat: /etc/fuse.conf: Permission denied

and groups(1) returns

fjohnson adm dialout cdrom plugdev lpadmin admin sambashare

marked as duplicate by Gilles 'SO- stop being evil', slm, jasonwryan, Joseph R., Thomas Nyman Oct 17 '13 at 3:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 5
    Have you logged out and logged back in after the change? – tamarintech Oct 16 '13 at 15:02
  • 2
    See this as well. – Joseph R. Oct 16 '13 at 15:09
  • @esnyder- I've got too many things open to do that. Any idea why that would work? (It sounds like it would from what I have been reading) – fthinker Oct 16 '13 at 15:22
  • @esnyder,@Joseph R. - I've upvoted both of you since your comments were both correct. – fthinker Oct 16 '13 at 15:37
15

When you add a group to a user, this user should logout/login in order for the change to take effect.

You can also use newgrp command.

  $ id
  uid=1000(romain) gid=1000(romain) groups=1000(romain),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),105(scanner),110(bluetooth),112(netdev)
  $ sudo addgroup romain fuse
  Adding user `romain' to group `fuse' ...
  Adding user romain to group fuse
  Done.
  $ id
  uid=1000(romain) gid=1000(romain) groups=1000(romain),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),105(scanner),110(bluetooth),112(netdev)
  $ newgrp fuse
  $ id
  uid=1000(romain) gid=103(fuse) groups=1000(romain),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),103(fuse),105(scanner),110(bluetooth),112(netdev)
  • 4
    Note that the effect of newgrp fuse is not to let "Adding user romain to group fuse" to take effect, the effect is that the primary GID of the user changed which is fundamentally different - e.g. newly created files will have gid=103 rather than gid=1000. – Jakub Klinkovský May 26 '18 at 21:30
  • 3
    This is answer is not what i was looking for. im having same issue, when i add user to a group, it shows in /etc/group but doesnt show in groups, i have exited, logged back in, still not showing. I do have ssh multiplex on, i wonder if thats it, however I feel as if exiting should be enough. This is for Centos6, and this problem is consistent across multiple servers. newgrp just seems to be a temp workaround, where i want to set user perms, and want to make sure its working right. – Brian Thomas Jun 18 '18 at 17:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.