Jump to content

Permissions


Andreas.Emby

Recommended Posts

thefirstofthe300

So first rule of Linux: don't mess with ANY system files that have been added by the package manager.  Doing so will make uninstalling that package a PITA.

 

Second, Emby will already have permissions for the database provided you don't change the ownership after you start Emby for the first time.

 

Third, you can change the user and group that Emby runs under by editing /etc/emby-server.conf (I think...I use docker so the packages aren't overly familiar to me). If you change the user and group, you will need to change the ownership of /var/lib/emby-server to whatever user and group Emby is supposed to run as.

 

Fourth, the user:group that Emby runs as (emby:emby by default), should have read and execute access at a minimum to the media libraries (execute is so that it can open directories).  If you want Emby to save metadata into the folders, that will require you give Emby write permissions as well.

 

If you need more help with permissions, I suggest you do a Google search for how Linux permissions work as you will DEFINITELY have permissions issues in the future with something not Emby related.  I still do on occasion.

Edited by thefirstofthe300
  • Like 1
Link to comment
Share on other sites

Andreas.Emby

Ok, thanks. Emby have been running for a few days and I've watched things. It seems to be working. Anyway, I guess all I want to do is to change access (?) to everything in Videos/* for emby:emby. I still want to be able to have full control over the folder and its subfolders and every file included in those folders with my user account (I want to add files, remove files, change file names) without that in any way affecting the access that have once been given to emby:emby.

 

 
EDIT: According to log files subtitles are not being downloaded due to lack of permissions... I've now tried lots of stuff. It all comes down to this: Files already present get their permissions right (emby:emby), but whenever I create a new file it's me:me. Should I schedule a cron job that corrects the permissions? Is that how it's done?
Edited by Andreas.Emby
Link to comment
Share on other sites

thefirstofthe300

 It depends on how you are adding media to the library.  If you as a user are adding the media manually, the easiest way to automatically change the permissions would be a cron job to correct the permissions.  If you have another app adding the media to the library, like an automated Filebot script or Sonarr or Couchpotato, the easiest way to handle this would be to have all those apps run as the same user as Emby.  The permissions on the files would be set from the get-go; then, add your user to the emby group, make sure that Filebot, Sonarr, or CP is setting the octal permissions to something like 775 and you are good to go.

Link to comment
Share on other sites

Andreas.Emby

Okay. I've fiddled around with this. I think I got it working now...

 

I have a script file with this:

 

chown -R emby /home/me/Video
chgrp -R emby /home/me/Video
 
I'm running the script every hour with a root Cron job (sudo crontab -e).
 
I've added my own user ("me") to the group "emby" with sudo usermod -a -G emby me.
 
At some point (before handing over ownership of the folder) I did this: chmod -R g+swrx  /home/me/Video
 
Best practice? Probably not. Maybe this isn't overly complicated, but if you don't do this every day it gets a little confusing.
Edited by Andreas.Emby
Link to comment
Share on other sites

BinaryShrub

One thing I'd like to note... is that a Media folder MUST have execution and read permissions from the emby user. When adding media, there is a notification that reminds you that the emby user must have read access, but this is incomplete and should be corrected.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
pr3dict

I know this is old but how do I do this when it is a Samba share?

 

I have all my movies stored on a NAS that is sharing the points out via the network. I mounted the share in my emby server but emby cant see it... I believe I shared the data out via nobody so that everyone can access it.

 

I just tried changing the permissions with chgrp -R emby /home/me/Video but it said access denied. I imagine that is because the emby server doesnt have ownership of the files?

 

Anyway, how do I setup these samba shares so that everyone that wants to direct play the movies can but also have Emby access it as well?

Link to comment
Share on other sites

I know this is old but how do I do this when it is a Samba share?

 

I have all my movies stored on a NAS that is sharing the points out via the network. I mounted the share in my emby server but emby cant see it... I believe I shared the data out via nobody so that everyone can access it.

 

I just tried changing the permissions with chgrp -R emby /home/me/Video but it said access denied. I imagine that is because the emby server doesnt have ownership of the files?

 

Anyway, how do I setup these samba shares so that everyone that wants to direct play the movies can but also have Emby access it as well?

 

Hi, the mono runtime does not have native support for samba at this time. What you need to do is mount the network path as a local volume in the operating system, then Emby will be able to use that local volume.

 

Does this anwer your question? Thanks.

Link to comment
Share on other sites

pr3dict

Hi, the mono runtime does not have native support for samba at this time. What you need to do is mount the network path as a local volume in the operating system, then Emby will be able to use that local volume.

 

Does this anwer your question? Thanks.

 

not really thanks for answering at all though!

 

So, I understand that emby doesnt have native support for samba so I mounted the samba network drive as a local path "\\storage\Movies"

 

I used the  /etc/fstab file to put the path in and mounted it that way...

 

now emby accepts the path I give it for the new local mounted position but when I scan the library it doesnt see any movies or anything...

 

 

I am under the impression it has something to do with permissions? I mounted the drive as guest and all the movies and files in the directories are owned by "nobody" 

 

I did that so I wouldnt have to login when accessing the share drive.

Link to comment
Share on other sites

pr3dict

so I changed all the files to 777 permissions and it started working. I don't understand why though. I set the owner and group as emby/emby

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...