[Samba] Linux clients, "force * mode"

Michael Lueck mlueck at lueckdatasystems.com
Tue Feb 19 18:54:47 GMT 2008


Someone on this list suggested looking at "force * mode" to make Linux clients connecting to Samba servers create dirs/files with certain permissions.

I attempted it yesterday, and had to quickly comment out the added lines as both Windows and Linux clients could not connect to shares at all!

Today I started with uncommenting the lines on one share. I could still connect with both Windows and Linux. That seemed odd so I uncommented all lines I added yesterday, and both Windows and Linux 
clients can connect and access files.

However, "force * mode* entries do not seem to take affect.

Following is the initial share I am testing with:

[data]
    comment = Shared Application Data Files
    path = /srv/shares/data
    guest ok = no
    read only = no
    create mask = 0666
    directory mask = 0777
    force create mode = 0666
    force directory mode = 0777

And I use this command to connect to share from a Ubuntu 7.04 workstation:

/bin/mount -t cifs -o credentials=/home/mdlueck/.smbcredentials,uid=mdlueck,gid=mdlueck //ldslnx01/data /mnt/ldslnx01/data/

With a Windows 2000 computer connected to the domain, I can make dirs on the data share resulting in 0777 perms, and files resulting in 0666 perms.

With Linux I end up with 0755 perms on the dir, and I am unable to create files in the dir.

<><><>

Someone made this comment to my problem:

 >The create mask "bit-wise" removes the bits from the permissions.  So a
 >"create mask" of 777 will effectively remove ALL permissions from the
 >file.

I am seeing correct permission on files/dirs created by the Windows 2000 workstation. Dirs end up 0777, files end up 0666. So certainly no creating files with all permissions removed.

Could someone please shed light on this?

Thanks!

-- 
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/



More information about the samba mailing list