Emby users - ref: files permissions

  • This is not OMV directly related question, but it’s somewhat connected to OMV and I’m sure smart people here better then others positioned to know the answer to this.


    Say you use Emby server and it reads video files from a samba share controlled by OMV server, I wonder how do you solve an issue with allowing Emby to be able to delete videos directly from the Emby UI ?


    I think there maybe more then one way, I feel modifying ACL is one of them, but looking for best practices...


    Thx in advance.

  • What do you mean by "a samba share controlled by OMV server"?


    The short answer is: The user the Emby process runs as must have write permission on the files that are to be deleted.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • What do you mean by "a samba share controlled by OMV server"?


    The short answer is: The user the Emby process runs as must have write permission on the files that are to be deleted.


    So all I need to add a user in OMV "emby" and give it write permission via ACL

    Ok , thx !

  • Adding a user doesn't make a process run as that user or change filesystem permissions.


    I suggest not using ACLs unless you really understand what they do.


    You still didn't answer my question.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • What do you mean by "a samba share controlled by OMV server"?


    It means that a samba shared folder is part of OMV NAS and as such OMV has full control over it.


    Can you please then describe what you do in such situation?

  • You don't say if Emby is running on the same machine as the files and folders you want it to be able to delete.


    What user owns your media files and folders. What is the complete list of permissions on such a typical file and folder?


    Emby must be running as a user that has read and write permission on the files and read write and executable permission on the folders.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • I don't use VMs here so I have no suggestions about that.


    root doesn't own a single file on my system it doesn't need to. What is your use case that needs that?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • root doesn't own a single file on my system it doesn't need to. What is your use case that needs that?


    How can I find out answer to your questions "What user owns your media files and folders." ?


    Use case:


    emby user on a VM#1 steams video files

    video files live on a samba share on R Pi

    emby needs to be able able to delete video files

  • In the shell, cd into a directory you wish to learn about. Type:


    Code
    ls -al

    This will show you the ownership and permissions, etc.


    I can't help you with VMs

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • My opinion is that the root user ownership of your Videos folder is a poor choice.


    I can't say anything about the files because you haven't shown the permissions and ownership of them yet.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • My opinion is that the root user ownership of your Videos folder is a poor choice.


    I can't say anything about the files because you haven't shown the permissions and ownership of them yet.



    Files are the same:

    drwxrwsrwx 2 root users


    I did not do anything about permissions, connected a new drive, formatted, added shares etc.


    It could be that rsync kept the permissions.


    Ok and thx.

    Then - what permissions would you use and how would you change them ?


    Is ACL in OMV a good way to do so ?


    (the reason I am asking those details, so I want o do it right!)

  • Whatever process you ran to add the files was run as the root user without regard to preserving the ownership and permission attributes, if any existed. Never run anything as the root user unless it must be run that way. Never.


    You haven't shown the permissions of any files. What you posted:


    Files are the same:

    drwxrwsrwx 2 root users


    is for a directory.


    I don't set permissions using the OMV GUI, I do it by hand in the shell or via highly focused automated scripting. I don't use OMV's ACLs either.


    My media folders (more than 29,000) are owned by user fred and group users and have their permissions set to be 2755.


    My media files (more than 62,000) are owned by the same user and group as above and have their permissions set to 0644.


    If your media collection is organized properly it may be possible to change the ownerships and permissions in a bulk fashion in the shell using a very few specially crafted commands.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • I can post what I use to recursively bulk change permissions and ownership of my media files. This will unconditionally modify every file and folder it finds in the directory where it is run from, and within every directory and subdirectory below that one (recursively).


    Warning: If you run these commands in the wrong place on your filesystem it doesn't care. There is no way to determine what the permissions and ownership were before they were changed. Make sure you know what you are doing with this.


    Run these commands as root in the shell in the order shown. Change the path very carefully to be the starting point from which to make the changes. Change the user and group to agree with your use case. All my media files are in directories immediately below the path shown. The path shown is a mergerfs mount point made up of eight hard drives. But this detail is not important.


    I cut these commands out of a shell script. You could create such a script if you think you will need to run this often.

    Code
    find /srv/dev-disk-by-label-d1/sftp/outgoing/ -type d -exec chmod -R 2755 {} \;
    find /srv/dev-disk-by-label-d1/sftp/outgoing/ -type f -exec chmod -R 0644 {} \;
    find /srv/dev-disk-by-label-d1/sftp/outgoing/ -type d -exec chown -R fred:users {} \;
    find /srv/dev-disk-by-label-d1/sftp/outgoing/ -type f -exec chown -R fred:users {} \;

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • gderf


    That's cool and helps me get overall permissions settings into good order.


    That's goal #1


    Goal #2 - how do I allow a process/user on a different system using my share to delete files ? (W/R) in general case?


    I can add that user in OMV but so far it did make any difference


    This is def not a high priority issue, but very interesting ...

  • My media files are located on the same machine that Plex runs on so there are no problems with being able to delete files within Plex - Plex is specifically set up to allow deletions, it is not the default behavior. Plex (like all my dockers) runs as the same user that owns the files, so again, no problems.



    I use NFS for file sharing between Linux machines here. I no longer have any Windows machines here. There is user and group ID number equivalence between machines. So being able to modify or delete user owned files across machines just seems to work without any special setup.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!