0

Ok, this may look like it might be an Apache or an Owncloud question, but I think the way I want to try and solve the problem is a more generic one:

On a Mythbuntu 14.04 server box, I have Apache 2.4.7 running Owncloud. I want another application on the same system (the Amarok music player) having access to the music files managed by the Owncloud server. However, only the Apache user "www-data" has permission to read anything under /var/www/owncloud/data (they're supposed to be handled only through the Oc web interface or a sync client app). I think it wouldn't be a security problem to grant my user "ben" on that box read-only access to just the directory that contains all the music: /var/www/owncloud/data//files/Music But I don't know how to do that, or if it's even possible. chmod confuses me with the different notations, and also there's the thing of modifying permissions for just the one user. Can you help me with the right command?

  • have you added the user ben to the group that www-data is in? there should be some kind of group ownership of those files. – Optichip Dec 30 '14 at 23:56
  • @Optichip: Actually yes, I just thought of that, but maybe I did it wrong, because seemingly it didn't take effect: ben@hermann:~$ sudo usermod -a -G www-data ben ben@hermann:~$ groups ben adm cdrom sudo dip video plugdev netdev sambashare mythtv lpadmin i.e. after issuing the usermod command, I'm still not a member of the group www-data – Ben Opp Dec 31 '14 at 0:11
  • check the /etc/group file and see if you can see the www-data group in there and add yourself to the line. See if that helps. – Optichip Dec 31 '14 at 0:50
  • @Optichip, actually it did work the first time, I just got the command wrong for checking it: it should have been groups ben to list the groups that my user is in, instead of just groups which simply lists the groups existing system-wide. You should convert your first comment to an answer, because it solved the problem for using standard Linux permissions tools chown/chmod. I appears that to get specifically what I was asking for (give read-only to just one user) I'd have to resort to ACLs – Ben Opp Jan 4 '15 at 14:58
0

Add the user to the group www-data, this should allow the user to access the files that you need. See comments on the question if you need more information about it. sudo usermod -aG <groupname> <username> from a terminal window will add the user to the group for you.

  • ...and groups <username> will list the groups that your user is a member of, to check whether usermod was successful. – Ben Opp Jan 5 '15 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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