Tuesday, June 22, 2021

How to make File Immutable in Linux : Even Root cannot delete : CHATTR : LSATTR

[root@ip-10-79-197-70 ec2-user]# sudo chattr +i -V backup/iptables.backup

chattr 1.42.9 (28-Dec-2013)

Flags of backup/iptables.backup set as ----i-----------

[root@ip-10-79-197-70 ec2-user]# sudo lsattr backup

----i----------- backup/iptables.backup

[root@ip-10-79-197-70 ec2-user]# rm -rf backup

rm: cannot remove ‘backup/iptables.backup’: Permission denied

[root@ip-10-79-197-70 ec2-user]# sudo rm -rf backup

rm: cannot remove ‘backup/iptables.backup’: Permission denied

[root@ip-10-79-197-70 ec2-user]# exit

exit

No comments:

Post a Comment

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass