After
chattr +i /etc/hosts
I can't edit this file (obviously). But how can I revert it back. I need to edit this file and then lock again.
UPD
ls -l /etc/hosts
-rw-r--r-- 1 root root 274 2011-06-09 14:14 /etc/hosts
UPD 2
lsattr /etc/hosts
-----a-----------e- /etc/hosts
UPD 3
Thanx, @womble, I've removed a
attribute
chattr -a /etc/hosts
lsattr /etc/hosts
would be useful to see. Also, "Operation is denied" is not the usual error message you'd expect to see for a permissions problem; I suspect something else is wrong.Operation is denied
is my translation of error from my localization.C
locale and post them directly -- exact wording can be critical in diagnosing what's gone wrong.English
in whole system only.LANG=C <command>
will do it.