LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-01-2008, 07:38 PM   #1
danedmo
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
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
 
Old 10-01-2008, 10:10 PM   #2
WorldIsNotFair
Member
 
Registered: Jun 2008
Location: Jakarta
Distribution: CentOS 5
Posts: 89

Rep: Reputation: 17
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.

Last edited by WorldIsNotFair; 10-01-2008 at 10:57 PM.
 
Old 10-01-2008, 10:40 PM   #3
linux-lover
LQ Newbie
 
Registered: Oct 2006
Posts: 16

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

Thanks

Regards,

Linux-Lover
 
  


Reply

Tags
deletion, directory, file, permissions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent access to root folder ]SK[ Linux - Security 6 08-14-2007 06:48 AM
File and folder deletion Rick069 Linux - Software 5 02-13-2006 09:08 PM
BASH: how to automate deletion of oldest folder big_mike_jones Programming 18 11-22-2005 02:59 PM
ROX-filer: file deletion and trash folder woland Linux - Software 0 08-22-2004 11:16 PM
Automatic deletion of spam folder? RKris Linux - General 1 05-27-2003 08:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration