[CentOS] Centos 7 Samba - all shares read only

Gary Stainburn gary at ringways.co.uk
Mon May 8 11:32:19 UTC 2017


On Thursday 04 May 2017 17:54:57 Chris Murphy wrote:
> Pretty sure smb gets "control" of a directory via the group. For my
> setup, each directory defined by a path in smb.conf has group
> smbusers, and has rwx permissions. This is applied just to that
> directory, it is not applied recursively. The files and folders in
> that directory have the actual remote user's ownership and
> permissions.
>
> What is applied recursively is the selinux label. I find it's better
> to have a dedicated filesystem volume so you can use the mount option
> context="system_u:object_r:samba_share_t:s0" and that will apply that
> context to the whole file system. If a file system volume is being
> shared, then you'll need to use chcon -R
> "system_u:object_r:samba_share_t:s0" <path> to apply that context to
> everything. New files and directories will inherit this context (so
> long as it's a copy and not a move; so if you move things behind the
> scenes outside of samba, you can run into label problems since
> inheritance doesn't apply to moving).
>
>
> Chris Murphy

I have run the following commands for each share, to ensure that group 
permissions are are:


find . -type d -exec chmod 770 {} \;
find . -type f -exec chmod 660 {} \;

I can now create and delete files and folders using windows explorer. I can 
also create a new blank spreadsheet in Excel and save it to the share. 
However, when I then open that file in Excel again it comes up as Read Only.

Again, I can delete the spreadsheet using Windows Explorer

What I don't understand, apart from why the system is behaving like this, is 
what has changed that stopped it from working in the first place.



More information about the CentOS mailing list