Server Version#: Ubuntu 18.04 LTS
Player Version#: 1.15.8.1198
Up until the last two or three days, I was able to download my video files on one computer, copy them up to a local NAS and then down to my Plex server using folders like alpha and beta (not their real names).
Then I noticed that my Plex wasn’t adding my latest files to Recently Added. I checked out some posts and found that I had to change the permission settings on the folders/files to get Plex to see them.
Just to double-check, my folders are chown myname.myname and should be chmod 775 while my files are chown myname.myname and chown 664, is that correct?
I saw something in one of the posts that referenced plex.plex. I have a plex user (plex:x:132:video:x:44:plex) and a video group with a plex user (video:x:44:plex). Should I have something different?
And, other than updates, I haven’t changed anything on either computer recently so why the sudden need to file permissions?
Yes, it was a botched cut and paste. My groups show two lines (video… and plex…). I also added a media group like you suggested in other posts (media:x:1001:myname,plex).
I also made the changes you suggested in your “Automating Linux permissions using inheritance” post so my folders & files are now myname.media and my folders are 755 and my files are 644.
After a reboot, I’m assuming I need to do a Scan Library Files because some files are working and others aren’t.
Also, if I wanted my Plex server to be able to delete files from my TV, the folders would need to be 775 instead of 755, correct?
If you want Plex to write content (modify the directory by creating files – which includes deletion), Yes, you change the directory perm to 775 (give group +w under the g+ws)
So, as far as I can tell, all my folders and files have they’re permissions set correctly and the Plex app on my Tivo can see them but none of them will play.
I think a few reboots and several Scan Libraries have fixed most of my problems. If I find any files that give me trouble in the next three months, I’ll send the log files.
Well, everything is working up to a point. After downloading the video files to my Plex server, I have to manually chmod 644 them for the app to see/play them. The files are defaulting to 600.
However you’re adding files, your default umask is not setting permissions correctly.
Setting a umask 022 in your .profile will result in permissions 0644 when files are created unless you are downloading/using a tool and that program is expressly settings 600
I use qBittorrent for my downloading and I checked the download folder and the files are set to 664 (that’s before I move them to the NAS and then move them to a folder on my Plex server). They end up as 600 on the Plex server folder.
When you say .profile, do you mean the plexmediaserver.service file?
When I say .profile , I mean precisely that. It’s the file the shell executes just prior to showing you the command prompt.
plexmediaserver.service is the Plex service control mechanism. It handles all the aspects of starting and stopping Plex itself.
Which “Plex server” directory are you talking about? Where are these files being written to? This is making me very nervous and might be why you’re having problems.
I’ve been using this command (sudo find /home/myname/plex -type f -exec chmod 644 {} to fix the files and a similar one to change the folders from “plex” on down to 755.
I tried finding the “.profile” file with no success. Where is it normally located?
Putting media in your home directory is extremely problematic, which you are now learning.
Linux default security doesn’t easily let two users (you and plex) share the files when they are in either’s home directory.
I know this is a pain but here’s what I recommend:
I recommend setting up a shared area where Linux takes care of the permissions for you.
# elevate to root user
sudo sh
# make a place in /home for you and plex to share
mkdir /home/plexmedia
# now create your movies, television, music, photos, or other videos however you want it organized.
cd /home/plexmedia
mkdir movies tv music pics
# Set the master permissions on these empty directories before we start moving files in
cd /home/plexmedia
# Set the ownership (you own, but share with Plex)
chown -R myname .
chgrp -R plex .
# Set the permissions we want
find . -type d -exec chmod 755 {} \;
# Lastly, we set it to self perpetuate (each directory gets the flag which will be inherited as it grows)
find . -type d -exec chmod g+s {} \;
Now, as a test & demonstration, cp -r something into that area
Do the la -la
You’ll see You own it but Plex is the group member.
Speaking to your home directory,
if in /home/myname, you don’t have a .profile* file, you can create one
in it you can add the umask 022 line all by itself.
If in doubt, google how to do this. It’s part of the simpler admin skills you should have mastered at the command line.
So I don’t need to set up “-exec chmod” for the files in \home\plexmedia?
Sorry, when you kept mentioning .profile, I was thinking something like a plex.profile type file (which is why I couldn’t fine it), not a \home\myname hidden file. My bad.
Thanks, I DID read through your guide and it helped a lot. But I guess it doesn’t work as well when you have the plex media folder under your \home\myname folder.
I’m working on moving everything over to \home\plexmedia. If I have any troubles after the move, I’ll let you know but I guess you can mark this Solved.
I went back through your guide and applied the commands to my new /home/plexmedia folder and newly moved files are still showing up as 600 instead of 644.