On Ubuntu I've made my user's Public folder an SMB share (using the same user as the smbuser) - I've then mapped it as a network drive on Windows XP.

I can edit, from Windows, any file on the share, but whenever I do it changes the permissions - it keeps owner permission but resets group and everyone permissions to read-only.

e.g. file is 777, I save it on the Windows side and now it's 744.

Is there anyway to stop this happening?


This is due to your Samba configuration. What you want is to set the file masks, so that when Samba creates or modifies a file, the permissions are kept at a known quantity.

This is what I use in my /etc/samba/smb.conf. These options are set explicitly for each share:

    directory mask = 0755
    create mask = 0644

See the Samba smb.conf documentation for the create mask and directory mask options. Use security mask if you want to mask ACLs as well.

It seems that under Ubuntu, the user public folders in Ubuntu may be controlled by the [public] share definition.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.