Best Answer: How Do I Make a File Undeletable in Linux?
Contents

To make a file undeletable by any system user, including root, you need to make it unmodifiable using using the chattr command. This command changes file attributes on a Linux file system.

How do I make a file Undeletable?

Method 1. Deny Security Permission to Make Files Undeletable

  1. Right-click the file or document in your PC > choose “Properties”.
  2. In Security, tab “Edit” to change permission > select “Add and enter Everyone”.
  3. Press “OK” and select the group to change Full control permission to Deny.
  4. Press “Yes” to confirm.

6 сент. 2016 г.

How do I prevent a file being deleted in Linux?

I know an useful commandline utility called “chattr” that is used to prevent files and folders from accidental deletion or modification in Linux. Chattr, short for Change Attribute, applies/removes certain attributes to a file or folder in your Linux system.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest