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 (All Versions)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.