LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-05-2006, 11:59 AM   #1
Dankles
Member
 
Registered: May 2004
Location: /dev/null
Distribution: Slackware
Posts: 245

Rep: Reputation: 31
Disable Delete permisions


Is there any way to give a user Read and write permisions, but not allow them to delete a file?
 
Old 05-05-2006, 12:24 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
I believe you remove the write bit from the directory, which should prevent them from changing the file name or deleting the file.

So chmod g-w directory. The read and execute bits need to still be set to allow them to read the directory. Make sure the file still has write permissions for the people who can modify it (chmod g+w filename). And make sure the user is part of the group.

http://www.linuxpowered.com/html/editorials/file.html

Last edited by pljvaldez; 05-05-2006 at 12:28 PM.
 
Old 05-05-2006, 12:34 PM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
You could enable the sticky bit on the directory containing the files you want users to read and write to but not delete (unless they are the ones who created the files). This can by done by doing something like,
Code:
#chmod +t /path/to/some/dir
 
  


Reply



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
howto chowto change file permisions in multiplhange file permisions in multiple dirs? pingvina Linux - Software 3 01-13-2006 03:10 PM
CD ejection permisions. e1000 Ubuntu 3 11-18-2005 09:33 PM
permisions charnel Linux - General 3 07-10-2005 02:53 PM
How to disable ftp user's ability to delete files BrianG Linux - General 2 01-15-2002 04:40 AM
Permisions ToeShot Linux - General 2 11-30-2001 12:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:52 PM.

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