Can't edit hosts file on macOS 13.5 (sudo not working)
0
votes
1
answer
1023
views
I don't have permission to edit the
hosts
file, even if I use sudo
and turn off SIP.
I use sudo vim /etc/hosts
to open the hosts
file. After entering :wq!
, it shows:
"hosts" E212: Can't open file for writing
like I am not using sudo
.
I also tried using sudo nano /etc/hosts
and it said:
[ Cannot open file for writing: Operation not permitted ]
Then I try sudo chflags nouchg /etc/hosts
, but it makes no change.
BTW, inside the Finder, there is a lock in the lower-left corner of the hosts
file. I try to change the lock status in **Get info** but the lock icon is not clickable.
Asked by SimpleMaxR
(21 rep)
Aug 15, 2023, 05:25 PM
Last activity: Jan 13, 2024, 07:00 AM
Last activity: Jan 13, 2024, 07:00 AM