Remove read-only status of hosts file

9,334

In Unix-like operating systems, you need to be root to edit the hosts file. This is controlled by file ownership and permissions.

You can change file permissions (if you own the file, or are root) and give everyone permission to write to the file using chmod o+w filename - But you shouldn't do this for the hosts file for security reasons.

I believe Mac OSX has sudo, you should use that. sudo editor filename (e.g. sudo vi /etc/hosts)

Share:
9,334

Related videos on Youtube

user39822
Author by

user39822

Updated on September 18, 2022

Comments

  • user39822
    user39822 almost 2 years

    I'm trying to edit my hosts file on a Mac Tiger OS. When trying to edit the file I get the following output and I'm unable to save any changes.

    "hosts" [readonly] 14L, 330C`
    

    How can I fix this?