Jump to content


Photo

Permissions

linux permissions

  • Please log in to reply
14 replies to this topic

#1 Andreas.Emby OFFLINE  

Andreas.Emby

    Newbie

  • Members
  • 5 posts
  • Local time: 09:49 PM

Posted 09 February 2016 - 05:43 PM

How do I set permissions correctly?



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 135735 posts
  • Local time: 04:49 PM

Posted 09 February 2016 - 05:48 PM

Hi, welcome. Permissions for what exactly?



#3 Andreas.Emby OFFLINE  

Andreas.Emby

    Newbie

  • Members
  • 5 posts
  • Local time: 09:49 PM

Posted 10 February 2016 - 01:59 PM

Everything Emby. (In an Ubuntu environment if that matters.)



#4 thefirstofthe300 OFFLINE  

thefirstofthe300

    Linux Geek

  • Members
  • 1323 posts
  • Local time: 01:49 PM
  • LocationEastern Oregon

Posted 10 February 2016 - 04:22 PM

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, 10 February 2016 - 04:24 PM.

  • Trizzone52 likes this

#5 Andreas.Emby OFFLINE  

Andreas.Emby

    Newbie

  • Members
  • 5 posts
  • Local time: 09:49 PM

Posted 10 February 2016 - 04:56 PM

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, 10 February 2016 - 05:40 PM.


#6 thefirstofthe300 OFFLINE  

thefirstofthe300

    Linux Geek

  • Members
  • 1323 posts
  • Local time: 01:49 PM
  • LocationEastern Oregon

Posted 11 February 2016 - 01:17 AM

 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.



#7 Andreas.Emby OFFLINE  

Andreas.Emby

    Newbie

  • Members
  • 5 posts
  • Local time: 09:49 PM

Posted 14 February 2016 - 03:52 PM

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, 14 February 2016 - 03:53 PM.


#8 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 135735 posts
  • Local time: 04:49 PM

Posted 14 February 2016 - 03:59 PM

Well done :)



#9 BinaryShrub OFFLINE  

BinaryShrub

    Advanced Member

  • Members
  • 39 posts
  • Local time: 12:49 PM
  • LocationCalifornia, USA

Posted 14 February 2016 - 05:17 PM

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.



#10 pr3dict OFFLINE  

pr3dict

    Advanced Member

  • Members
  • 279 posts
  • Local time: 04:49 PM

Posted 02 July 2016 - 03:43 PM

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?



#11 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 135735 posts
  • Local time: 04:49 PM

Posted 05 July 2016 - 02:27 PM

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.



#12 pr3dict OFFLINE  

pr3dict

    Advanced Member

  • Members
  • 279 posts
  • Local time: 04:49 PM

Posted 05 July 2016 - 06:01 PM

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.



#13 pr3dict OFFLINE  

pr3dict

    Advanced Member

  • Members
  • 279 posts
  • Local time: 04:49 PM

Posted 05 July 2016 - 09:43 PM

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



#14 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 135735 posts
  • Local time: 04:49 PM

Posted 05 July 2016 - 09:59 PM

Well done, thanks for reporting back. If you still have a server log from prior to when you did that, it might illuminate the access problem:

 

http://emby.media/co...port-a-problem/



#15 pr3dict OFFLINE  

pr3dict

    Advanced Member

  • Members
  • 279 posts
  • Local time: 04:49 PM

Posted 05 July 2016 - 11:55 PM

I dont think its a problem with emby I think its just my understanding of setting up linux...







Also tagged with one or more of these keywords: linux, permissions

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users