LinuxQuestions.org
Register a domain and help support LQ
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 06-03-2010, 07:12 AM   #1
tirengarfio
Member
 
Registered: Nov 2006
Posts: 47

Rep: Reputation: 15
I can remove a file with the permissions 444.Any way to lock it to avoid removing it?


Hi,

i have a file with these permissions: 444 (r--r--r--).

If i try to delete it, i get this message:

Quote:
rm: remove write-protected regular file `avatar_generico.jpg'?
So i can finally removed it.

Is there any permission to not remove it in any case?

Regards

Javi
 
Old 06-03-2010, 07:21 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,597

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Hi,

Use
Code:
chattr +i avatar_generico.jpg
 
Old 06-03-2010, 07:22 AM   #3
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 173Reputation: 173
rm seem to forgot about permissions

check this thread:http://ubuntuforums.org/showthread.php?t=1322037
 
Old 06-03-2010, 07:24 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Removing a file means to update the directory content - write permission on the folder where the
file is located allows you to override the read-only file permissions (as in your example).

The same folder write permission would also allow you to rename/move the file (and even get ownership).

Making the folder (and all parent folders) read-only will prevent deletion (except by root user).

Last edited by timmeke; 06-03-2010 at 07:25 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied gabsik Linux - Server 6 08-30-2012 10:39 PM
Avoid script running multiple times by file lock edenCC Linux - Newbie 6 10-23-2009 07:21 AM
Permissions ( to avoid unwanted things ) spiriad Linux - General 2 01-18-2009 01:20 AM
i am writing to a chmod(444) file. am i missing something? nkoplm Linux - Security 2 11-14-2006 09:06 PM
force delete/remove and mass file permissions-setting moxieman99 Linux - Newbie 2 02-15-2004 12:43 PM


All times are GMT -5. The time now is 01:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration