Messed something up with permissions

  • Hi guys,


    I've tested a lot the last weeks and finally changed the OS drive. Therefore I installed OMV completely new on the new OS drive and mounted the data drives (ext4) with my existing files. Now I'm running into some permission issues and I'm not able to solve them on my own. I tried to change it with "chown" and "chmod", reboot the server afterwards but it didn't solve my problems. ?(
    I'm able to create new subfolder but don't have the permission to rename existing subfolder or copy files over samba into them. I set read/write privileges over webui for the user and the main folder belongs to root:users with 2775 permission.
    Any ideas how I can solve the issue? Thanks

  • The 2 at beginning of the chmod is the problem. The defaults on samba create mask are 664 I think for files. That 2 is telling folders/files below it's level to inherit same gid.

  • 0775 for the 4 digit. I am looking up exactly what the 2 effects. I always forget.


    It says files inherit group. So it seems you should be able to write if your user was created in the web gui.


    Existing subfolder might be chown root:users. If your user is say "joe", joe would not be the owner of the existing stuff. So he would not be able to delete or overwrite. joe should be able to write to the folder thought if he is part of users group. The files that joe copies over to the folder will be chown joe:users. joe can rename and delete stuff that he owns, that would be chown joe:users.


    On the 4 digit chown if it is media type folder 0775 is good. If it is folder with sensitive stuff but you want users to be able to read/write it then you want 0770. The first digit is bad to set as 2 in a lot of cases so it is best not to use it. It would mess up a lot of plugins that use shared folders on the data drives.

  • Ah, ok. Thought if several users are in the same group and the folder has full read/write/execute access (775) for this group, every user in the group is able to delete or overwrite files and subfolder.

  • I changed it to the former user (e.g. joe:users :)) and reboot but i'm still not able to rename folder or files. Is there maybe a problem with the order I created the users after the new installation of omv? So they got another uid or something like that.

  • use the stat command on the files or folder and the id command on the user. you will see if there is a uid mistmatch.


    stat foldername (or path to folder if you not one level above it)
    id joe (whatever username in question)

    • Offizieller Beitrag

    Default the share to OMV initial creation


    chmod 0775 -R /pathtotheshared/share
    chown root:users -R /pathtotheshared/share


    Delete any ACL if present


    setfacl -bR /pathtotheshared/share


    Set access to samba share with privileges not ACL. Don't forget to restart the daemon and disconnect all windows clients with net use (in each client) or pid at OMV for Samba to apply the current directives

  • No success. But if I mentioned tekkbs former reply right, I'm only able to rename the folder, if the user from my Windows pc is the owner of the share. So root isn't the original owner because I copied the whole Series folder with another win-user (read/write permission) and smb onto my shared pool (aufs).
    So confusing as a linux newbie. :S

  • The root can change to whatever permission wants.

    Good to know. It's beginning to add up. :)



    Thats permission inheritance in samba. If you enable that, you should be able to edit them, even if other user created it.

    Was enabled before.


    Still don't be able to edit. I've shared the whole aufs pool and copied my folder into it but I only have the issue by 3 of 6 folder. For the seventh folder I don't get access in general (see pic below). All subfolders of the aufs pool belong to root:users with 0775 permission.


  • Sry forgot to mentioned it. Format of all hdds is ext4. Until now I haven't used ACL once. Reading a lot about troubles with ACL in this forum, so I avoid to use it. :)
    If I close all folder on my windows machine, there are no locked files. Or have I to delete/kill more?


    • Offizieller Beitrag

    You can kill the connected client and connect again. Also samba is not very effective in applying directives. So every change you need to restart samba and disconnect every client.
    Look at the privileges for the share, are you allowed to read-write with those credentials?


    Read the guide in my signature, is a little bit long...but if it helps

  • Killed the connected client and restart samba service.

    Code
    root@Server:/# kill -9 3863
    root@Server:/# service samba restart
    Stopping Samba daemons: nmbd smbd.
    Starting Samba daemons: nmbd smbd.


    User is allowed to read-write under privileges but in the samba status is "RDONLY". Or isn't it important?


    Nevertheless i will read your guide. ;)


Jetzt mitmachen!

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