3

I want to place a file in an FTP users directory (a readme) and make it so they cannot delete it.

I've got /home/user/iso/readme.txt uploaded as root, permissions set to 0444 - (r--r--r--) Yet when I log in as a normal user I can delete it. How can I prevent this?

0

1 Answer 1

12

To remove a file you need write access to the directory it is in, to modify the file you need write access to the file. They are two different operations.

So if you wish to stop a user from removing a file, it cannot be in a directory that user owns since ultimately then can always make that directory writable to themselves.

You might be able to do it with more granular tools such as ACLs for SELinux etc

1
  • 2
    Aha, okay so I placed it inside a directory called 'Please Readme' with 0555 permissions and now it is working correctly. Thanks!!
    – Chud37
    Commented Oct 10, 2016 at 13:39

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