51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

如何在Macbook上编辑hosts文件?

英文:

How can i edit the hosts file on macbook?

问题 {#heading}

我想修改我的Mac上的hosts文件;然而,我遇到了阻止我这样做的权限问题。

我尝试使用'sudo'命令打开文件,但当我尝试保存更改时,出现错误,指示我缺少必要的权限。

此外,我已经禁用了系统完整性保护(SIP),但不幸的是,这并没有解决问题。 英文:

I would like to modify the hosts file on my Mac; however, I am encountering permission issues that prevent me from doing so.

I have attempted to open the file using the 'sudo' command, but when I try to save the changes, I encounter an error indicating that I lack the necessary permissions.

Additionally, I have disabled System Integrity Protection (SIP), but unfortunately, this has not resolved the issue.

答案1 {#1}

得分: 0

我已找到解决方案。

我在终端中输入了以下命令,现在它正常工作:

sudo chflags nouchg /etc/hosts
sudo chflags noschg /etc/hosts 英文:

I have found the solution.

I entered the following commands in the terminal, and now it's working:

sudo chflags nouchg /etc/hosts
sudo chflags noschg /etc/hosts

赞(0)
未经允许不得转载:工具盒子 » 如何在Macbook上编辑hosts文件?