What can prevent root from modifying or deleting a file when SELinux is disabled?
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 3
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
