Samba file sharing on Ubuntu doesn't mask or force permissions for new files

12,622

I would try removing the create and directory mask settings. I can get it to work by just using this:

force create mode = 0775
force directory mode = 0775
force user = zuallauz
force group = www-data

That forces all the new directories and files created to have 0775 permissions.

Failing that you could try setting the parent directory manually once via command line to 775 (or whatever permissions you need) then using:

inherit permissions = yes

Theoretically all new files should inherit their parent directory's permissions. Don't forget to restart samba after changing the config:

sudo restart smbd
sudo restart nmbd

See good documentation on all the settings here.

Share:
12,622
Aharon Rossano
Author by

Aharon Rossano

Updated on June 04, 2022

Comments

  • Aharon Rossano
    Aharon Rossano almost 2 years

    I've setup a shared folder on my Ubuntu 10.4 server using Samba and put in the following configuration to the shared folder:

    [share]
        comment = Ubuntu File Server Share
        path = path..
        browsable = yes
        valid users = @team
        write list = @team
            force group = team
            writable = yes
            printable = no
        guest ok = no
        read only = no
        create mask = 0664
        directory mask = 0775
        force create mode = 0775 
    

    My issue is that new files created are still coming up with 644 instead of 664. Any suggestions on what else to try to ensure that it corrects the permission?

  • Aharon Rossano
    Aharon Rossano about 12 years
    thanks for the reply. i tried using force create mode = 0775 and i still get -rw-r--r-- for files. directories seem to be working correctly: drwxr-xr-x.