Really struggling with SAMBA and file permissions

Server Version#: 1:14.1.5488 running on Centos 7.6.1810 VM on ESXi v6.5
Player Version#: Chrome 72.0.3626.121 on Mac Mojave

I’ve managed to set up a new Plex Media Server on a CentOS VM, one of the supported distributions for Plex. That wasn’t too difficult, though I had several false starts before finding the latest ESXi version that will run on an ageing Xeon CPU.

But I’m really struggling to understand how to set up SMB file sharing, to allow me to upload media files to the server.

Installing Plex sets up a home directory for the use Plex at /var/lib/plexmediaserver, and a subdirectory Library. Both are owned by user plex, group plex, with directory permissions 0775.

I set up firewall rules according to the installation guide for Plex on Centos that I found which opens a number of TCP and UDP ports.

I installed SMB server, client and common packages using Yum, and tried to configure SMB manually, then connect to it using first Windows 7 then Mac OS Mojave clients. I failed. I can see the shared folders, but can’t see even the one text file I put in my home folder, nor access the subfolders in the /plexmedia folder and subfolders that I created manually

I installed the Webmin service to make server management easier, and re-tried setting up the SAMBA configuration first for the Plex /var/lib/plexmediaserver home directory, then when that didn’t work tried setting up a separate /plexmedia folder and subfolders. I also configured a share for the user john home directory, then tried to connect from Finder/Go/Connect to Server.

I set up an SMB user john matching the Unix user john, which is supposed to set permissions correctly in the /home/john folder, but it didn’t. I reset them manually to 775 for my home folder, and created one test text file permissions 777.

I can connect from my iMac macOS Mojave using Finder/Go/Connect to Server, and can see the /plexmedia directory, my home directory john and the homes directory in Finder when I have entered the ‘Connect As…’ parameters of my Unix login name and pw.

But I can’t see any files, even the text file, in any of the directories, nor any of the subdirectories in the /plexmedia directory.

And when I try to copy a file from the Mac to the server, I first get prompted for my Mac username and pw, then am told that “items can’t be copied to folder ‘john’ because you don’t have permission to read them” (my italics on read). I checked the folder permissions as 755 and file permission as 777, user john group users.

I get similar problems connecting from a (real) Windows 7 machine. I can browse the network, and see the shared folders, but can neither open them to read, nor copy anything into them.

I’ve been going round in circles this evening, trying to understand what’s stopping the connections and am baffled.

Any help welcome!

I know it’s not strictly a Plex issue, but I don’t know where else to ask for help. I’m not totally inexperienced in Linux, but far from an expert, and I simply can’t understand why SMB won’t seem to work for either my own Linux home folder, or the plexmediaserver home folder.

On my Synology NAS all the media files and folders are owned either by me (john) or admin, and the group users. It was easy to upload and edit/move media files from Finder or Windows Explorer.

On the CentOS server, where would you advise me to set up the media library, with subfolders for music, photos, video/shows and /video/movies (or films)?

And with what ownership and permissions?

When I’ve set those up in a recommended place, I’ll try again to share them.

Enough for tonight! Heading towards midnight.

Have you given this a read?

1 Like

That isn’t exactly what I want to do.

But I FINALLY found (as I had suspected) that SE Linux was stopping access, even to a public share with guest access and RW permissions.

This command

setsebool -P samba_export_all_rw=1

seems to have unlocked the security barrier.

Now to get it to work for a secured share…

[LATER]
And with the aid of Webmin, I finally succeeded. But VERY frustrating, until I found a post with this SE Linux command. Other threads on Samba and CentOS 7 didn’t mention SE Linux.

I’m sorry about that. I will update the tips.

Personally, I disable SELinux. It has historically been more trouble than it’s worth.

I am not running a commercial or government facility in my home office where I need all the protections it offers.

I think I disabled it too, the last time I set up a more general purpose server on the same hardware but with different OS (I think ClearOS, which is based on CentOS).

But I’d forgotten about it, until eventually bafflement gave way to a glimmer of recollection that SE Linux might be the cause of my frustrations. It’s enabled by default in CentOS.

Then a bit of general googling eventually landed on a longer thread, of which this was a small part.

All going well now, and busy transferring the media content over to the newly created Plex server.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.