Hi guys, I'm trying to modify the hosts file in linux '/etc/hosts/' but it's set to read-only and I can't modify it. I tried chmodding the file but It didn't work. I tried chmodding it to the following: chmod 720 /etc/hosts chmod 644 /etc/hosts chmod 700 /etc/hosts chmod 670 /etc/hosts chmod 600 /etc/hosts chmod 644 /etc/hosts but it only seems to open under 644 but no modifying allowed. Any help would be greatly appreciated. Kind Regards.
Which user are you logged in as when you attempt to chmod it? The /etc/hosts Code (markup): file should be owned by root and the wheel group so regular users will not be able to change its permissions. Also, it might have an extended file flag set. If you $ man chflags Code (markup): you will find out about these extra flags and how they are used.
do this on the file: lsattr /etc/hosts See what the "real attributes are". if it shows an attirbute with an "i" lke this: ----i-------- Then it has the unmutable bit set (spellling) As root run this on it: chattr -i /etc/hosts Then try setting your permissions as needed and editing the content of the file, you host probably did this while hardening the box from hackers 'n such. - Sebastian Rametta