Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Jun 20 '13 at 9:06

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

1 Answer 1

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

Your Answer

 
discard

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.