英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论