I need help with SMB configuration.

    • OMV 4.x
    • I need help with SMB configuration.

      Hello everyone!
      I recently reinstalled OMV 4 over OMV 3 and have everything set up and running fine.
      But I still can't figure out how to change default share "create mask = 0664" and "force create mode = 0664".
      There is an information in OMV docs: "Is possible to add extra options in the general and share configuration at the bottom with a multi line text field. This options are hardcoded in the mkconf script but they can be changed using environmental variables." But I don't know the right command to do it, can someone share his/her knowledge about environmental variables?

      I need to change this because if I create a file (as an owner) through samba I'm not getting execute permission for that file. Currently using "acl allow execute always = yes" but this workaround does not satisfy me ;/

      Edit:
      One more thing.
      Let's say I have shared folder "Data" and if I add these two lines:

      create mask = 0755
      force create mode = 0755

      in Extra options in Edit Share "Data", then my smb.conf looks weird...

      Source Code

      1. [Dane]
      2. path = /srv/dev-disk-by-label-data/Dane
      3. guest ok = yes
      4. read only = no
      5. browseable = yes
      6. inherit acls = yes
      7. inherit permissions = no
      8. ea support = no
      9. store dos attributes = no
      10. vfs objects =
      11. printable = no
      12. create mask = 0664
      13. force create mode = 0664
      14. directory mask = 0775
      15. force directory mode = 0775
      16. hide special files = yes
      17. follow symlinks = yes
      18. hide dot files = yes
      19. read list =
      20. write list =
      21. create mask = 0755
      22. force create mode = 0755
      Display All
      Shouldn't number 21 and 22 replace current number 12 and 13 instead of duplicating them?

      The post was edited 4 times, last by nbbt ().

    • nbbt wrote:

      Shouldn't number 21 and 22 replace current number 12 and 13 instead of duplicating them?
      Samba uses the last parameter that it reads. So, 21 and 22 will be the lines it uses. That said, to change the default, add the following lines to /etc/default/openmediavault:

      OMV_SAMBA_SHARE_FORCECREATEMODE="0755"
      OMV_SAMBA_SHARE_CREATEMASK="0755"
      omv 4.1.9 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.10
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      Samba uses the last parameter that it reads. So, 21 and 22 will be the lines it uses. That said, to change the default, add the following lines to /etc/default/openmediavault:

      OMV_SAMBA_SHARE_FORCECREATEMODE="0755"
      OMV_SAMBA_SHARE_CREATEMASK="0755"
      Thank you Aaron! Added those lines and it's working exactly how I wanted.

      EDIT:
      Aaron one more question about permissions if you don't mind.

      For newly created files (from ssh, downloaded through Transmission etc.) permissions are being set to 666. Any way to change this?
      I have already set ACL's for that folder as follows:

      Source Code

      1. getfacl /srv/dev-disk-by-label-xxx/folder1/folder2/
      2. getfacl: Removing leading '/' from absolute path names
      3. # file: srv/dev-disk-by-label-xxx/folder1/folder2/
      4. # owner: ownername
      5. # group: users
      6. # flags: -s-
      7. user::rwx
      8. group::rwx
      9. other::rwx
      10. default:user::rwx
      11. default:group::rwx
      12. default:other::rwx
      Display All
      But still whenever I create a new file inside 'folder2' it gets 666 permissions instead of 777. No idea why...

      The post was edited 4 times, last by nbbt ().

    • nbbt wrote:

      permissions are being set to 666. Any way to change this?
      While it looks like your ACLs should set it correctly, why do you want files executable when they are on a data drive mounted noexec?
      omv 4.1.9 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.10
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • Oh this makes things clear! Had no idea that OMV is using noexec parameter by default.
      I found your answer in some older thread saying that removing noexec from OMV_FSTAB_MNTOPS_EXT4 should be enough.
      Hope that is also correct for OMV 4.
      Thanks Aaron, again. You saved me a lot of time :)
    • Users Online 1

      1 Guest