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/hostswould 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. – womble Aug 11 '11 at 8:21Operation is deniedis my translation of error from my localization. – fl00r Aug 11 '11 at 8:24Clocale and post them directly -- exact wording can be critical in diagnosing what's gone wrong. – womble Aug 11 '11 at 8:28Englishin whole system only. – fl00r Aug 11 '11 at 8:30LANG=C <command>will do it. – womble Aug 11 '11 at 8:30