如何在Macbook上编辑hosts文件?

huangapple go评论107阅读模式
英文:

How can i edit the hosts file on macbook?

问题

我想修改我的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

得分: 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

huangapple
  • 本文由 发表于 2023年8月10日 17:07:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76874223.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定