Jump to content

Problems with permission on Linux


Recommended Posts

Kodi_Newcomer
Posted

Hello Com,

I hope im right here. How can i change something with user:group. I mean emby runs as user emby, but will that emby is in the group for my media folders. So how can i change this now, that it its emby:medieafolders ? The Problem is, that emby cant delet files and folders, because permissions error.

Or what i can do that it works ? At the moment i go manual over terminal and chmod the folders time in time to change to 777 that emby can delet files and folders.

 

Greet's

Newcomer

Posted

Hey u need to set permissions like this on folders where your media is:

sudo setfacl -m u:emby:rwx /home/user/media
sudo setfacl -R -m u:emby:rwx /home/user/media
sudo setfacl -R -d -m u:emby:rwx /home/user/media

 

cheers

 

  • Like 1
Posted

HI, also have you taken a look at this?

 

Kodi_Newcomer
Posted
42 minutes ago, kikinjo said:

Hey u need to set permissions like this on folders where your media is:

sudo setfacl -m u:emby:rwx /home/user/media
sudo setfacl -R -m u:emby:rwx /home/user/media
sudo setfacl -R -d -m u:emby:rwx /home/user/media

 

cheers

 

But what happens, when the other tool create a new folder, then i have to do this again ? I will do this like the other tools. Emby:Mediafolder. So Emby is in the group mediafolder and have read write access to the folders and files. So how can i set up emby that he is always in this group so i have not to do that manual again and again for new folders and files ?

Posted

This is the easiest way, for other tool you can add that tools user to emby group.

Also look at the post that Luke posted, there is alot of information on this forum that will help.

Cheers

Kodi_Newcomer
Posted
11 minutes ago, kikinjo said:

This is the easiest way, for other tool you can add that tools user to emby group.

Also look at the post that Luke posted, there is alot of information on this forum that will help.

Cheers

How it works i know, when i read the first part of lukes link. But my problem is, have some tools all this tools are setup so user:mediafolder group. All the tools works fine. So that should be working that i can change emby:mediafolder or is this not working ? I have looked in the systemd emby service, there is only user:emyb no group entry or so.

Or did emby only work emby:emby ?

I have tried add emby to group mediafolder, but this will not work.

Posted (edited)

The "-d" option posted  by @kikinjo is what allows new files and directories to inherit the ACLs for the emby user to retain access. 

If you want Emby to have a different runtime group you can change the primary gid for the emby user or update the service unit to run as another group. If running docker then give it the alternate gid.

 

 

 

Edited by Q-Droid
  • Like 1
Kodi_Newcomer
Posted
37 minutes ago, Q-Droid said:

The "-d" option posted  by @kikinjo is what allows new files and directories to inherit the ACLs for the emby user to retain access. 

If you want Emby to have a different runtime group you can change the primary gid for the emby user or update the service unit to run as another group. If running docker then give it the alternate gid.

 

 

 

Can you help me for this, im not so fit with linux. Where can i change this things ?

Posted

What distro are you running?

 

Kodi_Newcomer
Posted
3 hours ago, Q-Droid said:

What distro are you running?

 

Im running on debian bookworm, when you mean this.

Posted

You can change the runtime group by adding an override to the emby-server unit. The command opens an editor then you can add the lines below it. Replace value with the existing group name you want to use. Old files will retain their ownership and new files created by emby will have the new group ownership.

systemctl edit emby-server.service

[Service]
Group=value

Save and restart the emby-server service.

  • Like 1
Kodi_Newcomer
Posted

Failed to create directories for "/etc/systemd/system/emby-server.service.d/override.conf": File or directory not found.

I have looked at the folder, there is nothing with emby-server ...

Posted

Did you run it as root or sudo? 

Kodi_Newcomer
Posted (edited)

without root and sudo. But in the path there is no emby... Should i try it with sudo ?

I try'ed it with sudo, i have seen some lines, with #. I add group=medienfolder.

Quote

Editing "/etc/systemd/system/emby-server.service.d/override.conf" canceled: temporary file is empty.

 

Edited by Kodi_Newcomer
Posted

Add new lines, no #. 

Kodi_Newcomer
Posted

Yes i did. I delet the # from [Service] it changed to green, then i add a line without # Group=mediafolder. Safe, yes, and then the line was dropped in the console.

Posted

Did you read the text while in the editor? There is a section for the additions, they need to be between those two lines. 

Kodi_Newcomer
Posted (edited)
15 minutes ago, Q-Droid said:

Did you read the text while in the editor? There is a section for the additions, they need to be between those two lines. 

Oh men, im so blind. Now it works 🤫So now i have to restart the emby server and it should work. What happend when i update emby, must i do this again ?

I thank you very much my friend !!!🤗

Edited by Kodi_Newcomer
Posted

No. This approach is the way to make changes persist across updates. Making these changes in other ways run the risk of being changed back when you update the server. 

Easy way to check is looking at the emby log files ownership. New ones should have the new group. 

  • 1 year later...
Murat6559
Posted
On 12/18/2024 at 7:14 PM, kikinjo said:

Hey u need to set permissions like this on folders where your media is:

sudo setfacl -m u:emby:rwx /home/user/media
sudo setfacl -R -m u:emby:rwx /home/user/media
sudo setfacl -R -d -m u:emby:rwx /home/user/media

 

cheers

Adapt this according to your folder structure, it solves the problem

 

  • Thanks 1

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...