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

I have a folder shared by Samba and mounted on Windows. If I lock files in Linux I don't want Windows users to modify those. And If windows user will create a file/folder, in Linux I should be able to lock it. How do I do this.

share|improve this question

migrated from Jun 20 '13 at 9:06

This question came from our site for professional and enthusiast programmers.

The file system needs to allow writing as well as Samba for a remote user to make any modifications. Since both sets of permissions are independent, involving network shares does not complicate matters at all. Simply take away the write access for the appropriate files and users with the chmod command and Samba users will see an error message when attempting to write to these files.

share|improve this answer
Sorry my question was in complete. I wanted to do 2 things here. 1st, In Linux if I lock a file, windows user should not be able to edit it. As you said its simple, if I lock using chmod it will work. Next thing which I am unable to solve(I didn't explain in my question) is I want to lock files in Linux which are created on windows WITHOUT USING ROOT OR SUDO. If I use same user both the places even if I lock, windows can easily unlock it(bcz its running under same user). If I run with different users In Linux i am unable to lock it(WITHOUT USING ROOT) bcz windows created it with different user – Royal Pinto Jun 22 '13 at 9:19

You must log in to answer this question.

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