CentOS 7 Samba – All Shares Read Only

Home » CentOS » CentOS 7 Samba – All Shares Read Only
CentOS 4 Comments

No such thing as a dumb question. As the unix user gary I can successfully cd to the target directory and I can add/amend/delete files. The user gary and th smbuser gary are the same.

4 thoughts on - CentOS 7 Samba – All Shares Read Only

  • 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.

  • El 8/5/17 a las 13:32, Gary Stainburn escribió:

    Did 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,

  • No, but I do now.

    Also added

    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?

  • El 8/5/17 a las 14:21, Gary Stainburn escribió:

    Yes, do this (remove SeLinux context):
    ||
    find /path/to/your/folder -exec sudo setfattr -h -x security.selinux {} \;

    Hope this helps and solve your problem

LEAVE A COMMENT