I try to mount a samba share with cifs and set write permission to the group on the default file/directory creation mask.
After hours spent searching the web and trying, I can't get this to work, all my files are created with "rw-r--r--" and I want "rw-rw----"
My serveur is a Debian on Cubieboard (Cubian r4)
All umasks of all users are set to 002 using /etc/pam.d/common-session file with "session optional pam_umask.so umask=002"
This works great.
My client is Ubuntu Desktop 64bit 13.10.
All umasks of all users are set to 002 using /etc/bash.bashrc file with umask 002 (because the pam_umask.so doesn't work on the client).
This works great too.
User "bertrand" and group "nas" exist on both the client and the server.
On the server, user "bertrand" has only one group "nas".
On the client, user "bertrand" has "nas" as secondary group.
User bertrand has same password on client, server and samba server.
=> /etc/samba/smb.conf on the server :
[global]
server string = %h
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
name resolve order = lmhosts host wins bcast
dns proxy = No
wins support = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb
[NAS]
comment = NAS drive
path = /media/usbnas
valid users = @nas
force group = nas
read only = No
create mask = 0660
directory mask = 0771
=> /etc/fstab
on the client:
//smbserver/nas /media/nas cifs uid=bertrand,gid=nas,credentials=/root/.smbcredentials 0 0
The .smbcredentials
contains:
username=bertrand
password=********
The mounting point works on my client, I can browse my nas, create, delete, modify files and directories but all new files and all new directories always has read only permission for group.
How to give group write permissions by default ?
Thanks.