LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Prevent folder deletion, centos 5 (http://www.linuxquestions.org/questions/linux-newbie-8/prevent-folder-deletion-centos-5-a-673637/)

danedmo 10-01-2008 07:38 PM

Prevent folder deletion, centos 5
 
Hi,

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?

Thanks

Daniel Edmondson

WorldIsNotFair 10-01-2008 10:10 PM

well,

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:
ex.
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.
mkdir /father
chmod o+t /father [this will set sticky bit]

- create the shared folder
cd /father
mkdir children
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.

linux-lover 10-01-2008 10:40 PM

Hi, try this out. http://catcode.com/teachmod it is a good tutorial to start with.

Thanks

Regards,

Linux-Lover


All times are GMT -5. The time now is 03:43 AM.