I have added a group called Users to my system and created a few users giving them the group Users as a supplemental group (e.g. useradd -G Users auser). Created a samba password for these users and then added the following to my /etc/samba/smb.conf file:
[myothershare]Now, let's set SELinux settings (I'm assuming that you have already set samba_export_all_ro as per my previous post):
browseable=yes
path = /myshareddirectory
force group = +Users
valid users = @Users myuser
write list = @Users
create mask = 0770
force create mode =660
setsebool -P samba_export_all_rw 1And the security context type:
chcon -t samba_share_t /myshareddirectory/Let's set ownerships and permissions:
chgrp Users /myshareddirectory/You can now,assuming that your server is 192.168.1.64, finally, mount the share with (you might need to install cifs-utils):
chmod -R 770 /myshareddirectory/
mount.cifs //192.168.1.64/mycolshare /test -o user=myuserWhen you create a file now it should have rw permissions for both owner and group and thus files should be read and writeable for any users in the Users group.
-rw-rw----. 1 502 501 0 Jul 8 20:45 createdbyanotheruser
-rw-rw----. 1 501 501 0 Jul 8 21:02 createdbyauser
This comment has been removed by the author.
ReplyDelete