Trouble with file permissions on samba share.. file creation mask, etc.
I'll do my best to explain this. Let me know if any other information is needed. Full disclosure; I am using Centrify to integrate this system into Active Directory.
This is my smb.conf file:
[global]
security = ADS
realm = child.root.pri
workgroup = CHILD
netbios name = server
auth methods = guest, sam, winbind, ntdomain
machine password timeout = 0
passdb backend = tdbsam:/etc/samba/private/passdb.tdb
#
# Using kerberos keytab may lead to a serious samba crash.
# Centrify recommends against using it.
# Kerberos authentication is still supported without it.
#
use kerberos keytab = No
# If your samba server only serves to Windows systems, try server signing = mandatory.
server signing = auto
template shell = /bin/bash
winbind use default domain = Yes
winbind enum users = No
winbind enum groups = No
winbind nested groups = Yes
ignore syssetgroups error = No
idmap uid = 1000 - 200000000
idmap gid = 1000 - 200000000
enable core files = false
# Disable Logging to syslog, and only write log to Samba standard log files.
syslog = 0
[datasets]
path = /datasets
comment = ETL Datasets
read only = no
public = no
write list = +ETL_DataStage_Admin +ETL_DataStage_User KingZing
If user1 creates a file in the datasets share, user2 cannot change it.
KingZing goes to the share and creates test.txt - permissions are as follows.
-rwxr--r-- 1 KingZing KingZing 0 Jul 28 08:02 test.txt
So no other users can edit/change/delete that file... and that's now what we want. :(
What do I need to adjust?
Responses
Hi Aaron,
well, the setup you've implemented there works as expected - user1 may create his own files, user2 may not touch them. So the write list you've defined works.
What you probably want to achieve is that those files belong to a common group - correct? So group members can access those files?
That'd require to have all the users in the same group, and the files in /dataset belonging to that group. If that's what you want, change the group of /dataset to that group and if required, use the 'force group' parameter in smb.conf.
Oh, and I forgot to say - adding a x to the 'others' for the files may help as well :)
Cheers
Marko
create mask = 6770
directory mask = 6770
force create mode = 6770
force directory mode = 6770
force user = commonuser
force group = commongroup
It should work.
On this issue, you might want to create a local group (i.e. commongroup), then change ownership of your existing files/directories to that group.
After that change
force group = +ETL_DataStage_User to force group = commongroup
you also want to check you winbind..... options too. In my box, I have these
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
idmap backend = rid:ADS=16777216-33554431
winbind use default domain = true
winbind offline logon = true
winbind enum users = Yes
winbind nss info = Yes
winbind enum groups = Yes
winbind cache time = 60
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
