0

This question already has an answer here:

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?

marked as duplicate by Gilles, slm, Anthon, Karlson, jasonwryan Dec 31 '13 at 19:53

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.

  • @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 7:17
  • @janos also, /srv not /src, but thats hardly a problem. – Shelvacu Dec 30 '13 at 7: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 – Gilles Dec 30 '13 at 22:49
  • @Gilles That was the problem! After logging in again all works as expected. – Shelvacu Dec 31 '13 at 7:56
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 /)

  • It seems I had not known I needed to re-login! Thank you for your help. – Shelvacu Dec 31 '13 at 7:53

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