0

I have a directory, under /srv:

drwxrwxr-x 3 minecraft minecraft 4096 Dec 30 06:23 minecraft

Owned by user minecraft, group minecraft. Group has read/write/search permissions. I have a user, shelvacu, that is part of the minecraft group:

$ groups shelvacu
shelvacu : shelvacu sudo minecraft

And, as shelvacu, I run mkdir /srv/minecraft/testdir:

$ mkdir /srv/minecraft/testdir
mkdir: cannot create directory ‘/srv/minecraft/testdir’: Permission denied

Why? The minecraft group has write permission on the directory, and shelvacu is part of the minecraft group. What am I missing?

strugee
  • 14,723
  • 17
  • 73
  • 119
Shelvacu
  • 670
  • 3
  • 8
  • 17
  • @janos No, in fact that was what I first tried. I can cd just fine, but mkdir gives the same. I just did it slightly differently for clarity, assuming they were the same. – Shelvacu Dec 30 '13 at 07:17
  • @janos also, /srv not /src, but thats hardly a problem. – Shelvacu Dec 30 '13 at 07:18
  • Did you by any chance just add yourself to the group? This only takes effect when you log in. Use `id` to see your current group memberships. See [I added a user to a group, but group permissions on files still have no effect](http://unix.stackexchange.com/q/6387) – Gilles 'SO- stop being evil' Dec 30 '13 at 22:49
  • @Gilles That was the problem! After logging in again all works as expected. – Shelvacu Dec 31 '13 at 07:56

1 Answers1

1

First log in as the user shelvacu.

Then check your groups with id, so you don't add shelvacu to a group in one shell but try things inanother, not knowing about the change (as might happen with groups).

Change to /srv/minecraft, if that doesn't work, then you have not permissions on /srv (did make the /srv/minecraft as root for instance).

Now create directory with mkdir testdir. If that doesn't work, check the write permissions on current mount: mount | grep -F /srv (if that doesn't give results /srv is on /)

Zelda
  • 6,158
  • 1
  • 21
  • 27