Prevent folder deletion, centos 5
I am fairly new to linux and I'm not great with setting file permission yet.
I am using centos 5 and have a webdav service running.
I am trying to set up specific folders within the webdav that can't be deleted by anyone other then root while allowing the subfolders and files to be added and deleted by anyone accessing the files via webdav or ftp.
Does anyone know how to do this or have recommendations on other ways of accomplishing the same thing?
please mention more about the detail permission,
if u want the folder only to be written by root and readable to other then use chmod 644 [path to folder]
if there is an executable files and u want to grant it then use chmod 755 [path to folder]
if u want only those folder read write execute only by root the use chmod 700 [path to folder]
for your case, u can use this solution:
situtation is that you login as root
parent folder name = /father [sticky bit purpose for children folder, only writeable by root]
shared folder name = /children [user cannot delete this folder, but can write below this folder]
- create the parent folder with sticky bit set.
chmod o+t /father [this will set sticky bit]
- create the shared folder
chmod 777 children [everone can access & write, but not delete this folder]
another solution is using acl.
note: folder is owned by root [use chown to set owner/group]
Please spend a time to read the manual --> man chmod
try it and post the error if there is.
Hi, try this out. http://catcode.com/teachmod it is a good tutorial to start with.
|All times are GMT -5. The time now is 09:39 PM.|