Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .