File permissions

  • I know file permissions is always a difficult subject. I've tried to figure this out on my own but I'm getting confused.


    I've had a windows system running for quite some time and I'm migrating over to OMV. On my OMV box I've installed Emby. I use Emby to record Tv shows. After the show is recorded, my Windows Box grabs the show and converts it to .MKV while it removed commercials. Then the windows box renames the file and passes it to the OMV box along with an info file to help identify the file. Once in the OMV box, Emby adds the file to it's library and downloads extra metadata.


    What I end up with is directories containing files owned by root, Robert and Emby. And I'm having trouble getting all "users" to be able to read and write to all files.


    Up to now I've been using chown and chmod to correct the issue. But I record new shows every day and I can't continue to find and correct these errors.


    So how do I set up my shares to make all these files available to everyone, all the time?

    • Offizieller Beitrag

    How does windows acccess the files ? Via samba?


    Found it strange that files are created with root ownership.


    The key word here is common umask and common group for all users acceding the file. A flexible umask along all involved software that creates files/dirs in 775 mode.


    Does envy creates files also?

  • Yes, the Windows box monitors a SMB share.


    I SSH in a root (yes I know it's a bad idea but if I didn't then I'd just sudo anyway) so the directories are owned by root. Emby will create files in the directory which are then owned by the emby user/group. And the windows box access the share with the user name "Robert". So the video file will be owned by "Robert".


    I figure using "inherent permissions" would be the answer, but I don't understand the difference between the permission and the ACL. Or the appropriate way to set them up for shares.

    • Offizieller Beitrag

    I still don’t get what do you do as root to own files. Though everything is handled via emby or the windows software.


    You have to look for emby settings for umask, I don’t use emby by the way.
    Samba option in share “enable permission inheritance”, don’t bother with acl. After that try create a file a folder through windows and check that file is no 664 or folder 775.

  • "I still don’t get what do you do as root to own files. Though everything is handled via emby or the windows software."


    I record a Tv show. For instance "Friends". I record it for a couple years and eventually I will have every episode. Once I have them all I no longer need to record them. So I will move them to an "Archive" drive. So occasionally I manipulate the files through ssh as root. When I do (I assume) root becomes the new owner. I could move things around through SMB share but I'd prefer to have as few of them an I can get away with.


    Emby is cross-platform. I doubt they will ever have any file permission setting. I think they assume access to all files. On the Debian distribution they create an emby user and emby group. I think it's up to the user to make sure that user and group have access to files and folders.


    "Samba option in share “enable permission inheritance”, don’t bother with acl. After that try create a file a folder through windows and check that file is no 664 or folder 775."


    Ok, done. I copied a folder over from the windows box through the SMB share. It is owned by Robert. Emby scanned the folder and created .nfo files which it owns. I have a duplicate video file (owned by Robert) so I went in through the emby app and removed it.


    So Emby successfully deleted a file owned by Robert. Which is good. So I guess everything is okay. Ugly, but okay.

  • Okay thanks. I see I'm not the only one having an issue. That makes me feel better. You kind of went out of your way to look it up too. That is very cool.


    Just to ask one stupid question....Is there any way to set up a folder and have everything that is added to it be owned by one person and rwx by anyone?


    In the share I have everyone r/w. But that doesn't effect the file permissions.


    This is just confusing. I've searched for a primer on all this but couldn't get my head around it. Maybe I'm getting old.

    • Offizieller Beitrag

    The umask setting is what control how files are created in terms of permission mode. Files created by a user are owned by the same user, only root can change ownership for obvious reasons.


    Most software in Linux has umask setting, even the console shell. Sometimes they not call it umask, and goes like directory or file mode.


    https://www.cyberciti.biz/tips…mask-value-usage.html/amp

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!