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


    Shouldn't number 21 and 22 replace current number 12 and 13 instead of duplicating them?

    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • 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:


    But still whenever I create a new file inside 'folder2' it gets 666 permissions instead of 777. No idea why...

    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    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 :)

  • I've removed 'noexec' from OMV_FSTAB_MNTOPS_EXT4, mounted drives again and everything behaves the same way it did before.
    I'm not even sure is it possible to make new files with 777 permissions by default...

Jetzt mitmachen!

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