Plex And Docker user permissions

1liminal1

Member
Aug 5, 2022
40
0
11
So I come from windows server land, where I can create a group and a service account that I can then give access to files and folders.

But that does not seem to be the case here?

I've created a user and group in Proxmox. But how do I propagate that user to the CT to have access to a MP share? They are privileged containers.

Thanks
 
You have to create users and groups with the same UIDs and GIDs both in the LXC and on the host. Lets say a folder is owned by GID 2000. It doesn't matter what that user or group is called, all that matters is the UID and GID. Lets say you got a group "admins" with GID "2000" on the host and a group called "superusers" with GID "2000" inside the LXC. "admins" on the host got "Alice" as a member and "superusers" inside the LXC got "bob" as a member.
So on the host only Alice got access to that folder and inside the LXC only bob.
 
Thanks for that info,

Id seen the GID and UID when setting up my containers in docker. So I have an idea of what needs to be done, but not how.

So right now I have two LXCs; one for docker and one for Plex both accessing the same share as mount points added to the LXC's config.

I keep seeing CHOWN the folder for the group. But I don't want to take ownership, just give access.

So... create a user called Plex and a group called Media on the PVE host. Get the UID and GID

Create the same user/grp on the Docker host and the Plex host (and change Plex to run as that user? no idea how to do that) and then match the GID and UID. Also change the Docker Cts to run as that usr/grp

# usermod -u 2005 Plex
# groupmod -g 3000 Media
# ls -l

As an example

Give group Media RW access to the /mnt/share (no idea how to do that, as I said, root has ownership, don't want to change that. Just give the media group RW access)

And badda boom, I can change my media folder?

So I need to know how to give access to a folder and change the Plex user.

Actually changing the plex user looks pretty easy lol

https://dausruddin.com/how-to-change-plex-user-running-under-in-ubuntu/

So this is how I change file permissions?

https://www.pluralsight.com/blog/it-ops/linux-file-permissions

So I switch to the Plex user and do this?? Can I not add a group to the directory as root?? That would seem like the simple way to do it?

chmod +rwx /mnt/share

Linux is weird lol ;)
 
Ok, doing some hunting today and found this.

chgrp -R media mnt/share

So if root is the owner and I run this as root, will that allow any allow media and any user that's a member of media access to the share?