Weird linux problem: user is in www-data group in /etc/groups but groups command doesn't show him

5

I've come into something strange.

I just added a user to the www-data group, the user appears in both /etc/group and /etc/group-, however when I use the groups or id commands the group isn't listed; and the user can't chgrp a file into www-data.

What could be the problem? I'm using a Debian testing machine, never had this kind of problem.

kevinz

Posted 2010-01-28T20:45:22.857

Reputation: 153

Answers

3

Group membership is only processed on login. You can either:

  • re-login to pick up the new group
  • use newgrp www-data to run a new shell with gid set to www-data

MikeyB

Posted 2010-01-28T20:45:22.857

Reputation: 1 232

Thanks a lot; I was closing and opening a new terminal, I though that was enough. – kevinz – 2010-01-28T21:30:54.547

1Nope, the new terminal is just inheriting the uid/gids from what started it (probably your window manager) – MikeyB – 2010-01-28T22:03:35.763

I did not see the new groups until I did a su - $USER. login did not work either. – Jess – 2013-04-05T01:43:31.397