Help - Search - Members - Calendar
Full Version: undeletable files
Linuxhelp > Support > Technical Support
Termina
chattr tells me that ext2/3 cannot use 'chattr +u filename' to make a file undeletable.

I'd like to be able to put a file in a users directory, and make it impossible for them to remove it.

I try this, for example:

echo "hey" > locked
chown root:root locked
chmod 444 locked
su user
rm -f locked

The user is always able to delete this file, no matter the permissions or who owns it.

Does anyone have a solution for me?

I suppose I could make some unallocated space, use reisefs, and mount it where I need undeleteable files... but that seems like a pain. As does having cron continuously place the file back.

Thanks
dishawjp
Have you tried the:

chattr +i <filename>

command? The immutable switch is supposed to prevent deletion among other things.

I'm also suprised that a file owned by root and chmoded to 444 (read only) can be deleted by a normal user regardless of where it's located.

Jim
Termina
That did it, thanks. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.