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 MurphyI 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.
Jose Maria Terry Jimenez
2017-May-08 11:50 UTC
[CentOS] Centos 7 Samba - all shares read only
El 8/5/17 a las 13:32, Gary Stainburn escribi?:> 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. > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centosDid you tried something like: create mask = 0764 and directory mode = 0775 For folders In the share setup? Under which user/group are the files created? (i mean, once created, in the shared folder in Linux, what the user and group are? Also something like: force group = smbusers (or anything else you want) May help (add the users to that group) Best,
On Monday 08 May 2017 12:50:44 Jose Maria Terry Jimenez wrote:> Did you tried something like: > > create mask = 0764 > > and > > directory mode = 0775 > > For folders > > In the share setup?No, but I do now.> > Under which user/group are the files created? (i mean, once created, in > the shared folder in Linux, what the user and group are? > > Also something like: > > force group = smbusers (or anything else you want)Also added> > May help (add the users to that group) > > Best,I have done some testing and found that I have got to the point where I can create a 'New Text Document', edit it in notepad and save the changes. I can now also create a new blank spreadsheet, save it, load it, edit and save the changes. However, if I open an existing spreadsheet it still comes up as read only. Doing a 'ls -l' on the original file shows a '+' on the end of the file permissions. Other files have a '.' on the end. The newly created files have a normal file permission. I've had a quick Google and found that the '+' indicates a ACL has been applied. I have no idea how this happened as until now I wasn't even aware of them. Is there an easy way to remove the ACL from all of the files in these directory trees?