What can prevent root from modifying or deleting a file when SELinux is disabled?

Solution Verified - Updated -

Issue

  • A certain file cannot be modified or deleted, even by the root user Errors "Operation not permitted"

Example:

    chmod: changing permissions of '/etc/passwd': Operation not permitted
  • When directory has immutable attribute set while trying to delete the underlying files you get "Permission denied" error.

Example:

lsattr -R /etc/dhcp
---------------- /etc/dhcp/dhclient.d

rm -rf /etc/dhcp/dhclient.d
rm: cannot remove ‘/etc/dhcp/dhclient.d’: Permission denied

Environment

  • Red Hat Enterprise Linux (All Versions)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content