Ubuntu – Setting correct permissions

chmodchownpermissions

First of all let me say that i am almost new to Linux so please be patient 🙂
I have an Ubuntu 14.0.4 running on my Systems.

What i am trying to do is:
On my system there are sabnzbd and plex running.
sabnzbd is running as root and plex has an own user (plex) with an own group (plex).

What i need is that the user plex, myuser and also sabnzbd (root) have read, write and execute permission at /media and also all subfolders and files.
I studied now a lot of stuff at the internet and tried my luck with chmod; chown; the /etc/group file; and many more but i am to stupid to get it to work.

Can someone tell me what i need?

Best Answer

For a little more secure approach I'd recommend creating a group for those 3 users and then chown'ing the directory by the group.

1. sudo groupadd mygroup

2. sudo usermod -aG {group-name} username

In your case it'd be

sudo usermod -aG mygroup plex ; sudo usermod -aG mygroup root ; sudo usermod -aG mygroup myuser

3. chown -Rf :mygroup /media
Related Question