Help with shared permissions between LCs/VMs

pcmofo

Well-Known Member
Feb 12, 2016
35
0
46
41
I've gotten some great help in this forum so far with setting up my first Proxmox box and dealing with a few configuration issues. I've got most of them sorted out and I want to make sure that I am doing this correctly as far as users and permissions go.

My setup is Proxmox installed on a USB drive with an attached ZFS pool that has datasets for everything Proxmox needs (VMs, ISOs, backup etc) and a data set for shared media, as well as other datasets for things like backups.

Coming from FreeNAS I can set all the permissions (recursively with a simple checkbox) for users and groups as well as configure various sharing and services. FreeNAS made it easy to fix permissions in the GUI so I want to make sure I am setting my new VMs and users correctly. I also want to import my exist FreeNAS created ZFS pool and make sure the permissions are ok.

The main concern revolves around a "Media" dataset on the zpool. zpool/media lets say.
I have a LXC that runs Plex and mounts the zpool/media locally to access the files and serve them.
I have another LXC that runs Deluge that mounts zpool/media to write to the dataset
And I have another LXC that runs SAMBA server, mounts zpool/media (and others) and shares them via SMB with it's own config and permissions.

In FreeNAS I currently have 3 users, UserA, UserB, and a freenas user.
Everyone belongs to the group "home"
freenas user is set as the default user for guest access to the zpool/media share
UserA can access specific shares that UserB cannot and vice versa. Both can access zpool/media as registered users.

So the zpool/media dataset has it's own permissions already. Now at least 3 different Proxmox guest LXCs will be reading/writing from it as well as SMB clients.

When I set up the LXCs I created a new user, created a home group, added that user to the home group, and granted them sudo privileges in visudo and that is the user I use to ssh in and do everything on these LXCs.

Is their a "right" way to handle these permissions/users/groups for LXCs that will be accessing the same set of data from the Proxmox host?
 
For example... I mounted zpool/media to the torrent LXC with no problem. User A created the shares, and User B wants to write directly to that path, I got a permission error that the user cant write to the dir. I can make new directories inside zpool/media/newfolder but I cant write to an existing share which is drwxrwxr-x unless I 777 the folder and files inside. This is the kind of thing I am trying to avoid.
 
@pcmofo I am experiencing the same permissions issues as you. are you using samba to connect to the LXC from an external machine?
 
@pcmofo I am experiencing the same permissions issues as you. are you using samba to connect to the LXC from an external machine?
Yes. I believe I solved this with my samba permissions with some trial and error.
Code:
edit /etc/samba/smb.conf 

// Guests can read but only users on the write list can write

[Media]
path = /Media
read only = yes
write list = usr1 usr2 usr3
browsable = yes
guest ok = yes
create mask = 0777
directory mask = 0777

// Guests can't browse, only a single user can access this share

[PhotoVideo]
path = /PhotoVideo
valid users = usr1
read only = no
browsable = yes
create mask = 0755
directory mask = 0755

test to make sure settings are ok
testparm