1

Apart of unix perms are there other protection for don't remove or overwrite files?

By example:

  1. Restringing dirs than rm can delete.
  2. Overwrite protection when I made cat >file instead of cat >>file
  3. Overwrite protection option for default for all commands cp, rsync, etc. No configuration command by command.
  4. If there are a trash system, substituting overwrite by removing file and create a new one with same name.
  5. Delayed delete.
Stephen Rauch
  • 4,209
  • 14
  • 22
  • 32
Wallebot
  • 111
  • 2

1 Answers1

0

There are a bash option to protect for overwriten when send stdout to file. By example. cat >file.

Protect overwrite with noclobber.

set -o noclobber

To force overwrite:

program >| file2 

Read from: http://www.linuxhowtos.org/Tips%20and%20Tricks/Protecting%20files%20with%20noclobber.htm

Edit: Remove de write permision of dir prevent from remove file, but it's posible edit this file. Create new file is not possible, without write permission in dir.

with extended attributes in ext2-4 filesystem, is posible make a file unerasable if attribute isn't removed. chattr +u file

There are other atributes for make files only appendable o inmutable. Atributes explained in: Wikipedia

Wallebot
  • 111
  • 2