Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I am trying to share a directory between two users. The directory is at /reports. I have created a group (addgroup reports), changed the group of the directory, changed the permissions of /reports to allow full access to groups and added the two users to that groups by the following:

mkdir /reports
addgroup reports
chgrp -R reports /reports
chmod -R 770 /reports  
usermod -a -G reports user1
usermod -a -G reports user2

As user1, running the following, I get a permission denied error.

 touch /reports/foo.txt

Running groups user1 does not show reports group, but the mapping is there in /etc/group

but I still get a permission denied error.

share|improve this question

marked as duplicate by Takkat, Seth, stephenmyall, Raja, Florian Diesch Feb 27 '13 at 18:18

This question was marked as an exact duplicate of an existing question.

Btw: the Debian/Ubuntu-way of doing the group membership adjustments is: adduser user1 reports && adduser user2 reports ... it's a way more convenient wrapper around usermod. Using the old way is by no means wrong, however. – 0xC0000022L Feb 27 '13 at 13:56

It looks like logging out and logging in again resolved the issue.

share|improve this answer
That's right. You just discovered that group membership requires that the user log in. Had you tried it on another terminal which wasn't logged in before, the result would have been the same. – 0xC0000022L Feb 27 '13 at 13:54
I tried that, but I was on tmux, so I created new shells, and creating new windows doesn't count as logging in it seems. – ustun Feb 27 '13 at 14:12

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