Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
Great, thank you, it works now. – Delameko Jan 5 '10 at 9:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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