You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Unable to save /private/etc/hosts Error: /private/etc/hosts is readonly

mac os : 11.5.2(20G95)

sublime Text : 41113


Unable to save /private/etc/hosts Error: /private/etc/hosts is readonly


Use sublime Text app to edit the hosts file (/private/etc/hosts), and an error prompt window like this appears. Nothing like this happened a few days ago. After using the restore system, it returned to normal, but the same problem occurred a few days later.


Does anyone have the same problem?

How do you solve such problems?

Currently, only sudo vim can be used to edit, but this is a bit inconvenient for me.

MacBook Pro 15″, macOS 10.12

Posted on Aug 24, 2021 9:02 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 26, 2021 7:32 AM

易致 wrote:

Yes bro, it worked for me like this before, but now I don’t know why it became like this.
I want to ask if there is a solution? Or did i do something stupid

You'd probably have to ask Sublime Text.

It might be a privacy access issue in Security & Privacy system preferences. Try adding Sublime Text to Full Disk Access.

Similar questions

7 replies
Question marked as Top-ranking reply

Aug 26, 2021 7:32 AM in response to 易致

易致 wrote:

Yes bro, it worked for me like this before, but now I don’t know why it became like this.
I want to ask if there is a solution? Or did i do something stupid

You'd probably have to ask Sublime Text.

It might be a privacy access issue in Security & Privacy system preferences. Try adding Sublime Text to Full Disk Access.

Unable to save /private/etc/hosts Error: /private/etc/hosts is readonly

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.