I am logged into my remote VM (running out of `ESXi`) as user xyz. I wanted to change my `/etc/hosts` to add some network names that were not visible by default.

I first tried to run

```
sudo vi /etc/hosts

```

but when I got into `vi`, it was still telling me the file was read-only. Here are the privileges:

```
>ls -l /etc/hosts
-rw-r--r-- 1 root root 416 2013-06-19 08:08 /etc/hosts

```

I also noticed that almost every other file in `/etc` has a `lsattr` of `-----------------e-`, only `hosts` has `----i------------e-`. E.g.:

```
>lsattr /etc
...
-----------------e- ./python
----i------------e- ./hosts
...

```

Then I tried to `chmod` and here is what I got:

```
>sudo chmod +w /etc/hosts
chmod: changing permissions of `/etc/hosts': Operation not permitted

```

I thought that was weird because root (to which I am switched when I `sudo`) should be able to do anything. My `sudoers` file looks quite ordinary:

```
  1 # /etc/sudoers
  2 #
  3 # This file MUST be edited with the 'visudo' command as root.
  4 #
  5 # See the man page for details on how to write a sudoers file.
  6 #
  7 
  8 Defaults        env_reset
  9 
 10 # Host alias specification
 11 
 12 # User alias specification
 13 
 14 # Cmnd alias specification
 15 
 16 # User privilege specification
 17 root    ALL=(ALL) ALL
 18 
 19 # Allow members of group sudo to execute any command after they have
 20 # provided their password
 21 # (Note that later entries override this, so you might need to move
 22 # it further down)
 23 %sudo ALL=(ALL) ALL
 24 #
 25 #includedir /etc/sudoers.d
 26 
 27 # Members of the admin group may gain root privileges
 28 %admin ALL=(ALL) ALL

```

I am looking for an explanation why this is happening and how to work around it.