解决在windows上没有权限修改hosts文件的问题
发布日期:2021-05-06 23:59:27 浏览次数:40 分类:精选文章

本文共 1566 字,大约阅读时间需要 5 分钟。

github上的图片显示不出来,查了一下,发现是要改C:\Windows\System32\drivers\etc下的hosts文件,要在文件末尾增加以下内容:

# GitHub Start 140.82.113.3      github.com140.82.114.20     gist.github.com 151.101.184.133    assets-cdn.github.com151.101.184.133    raw.githubusercontent.com151.101.184.133    gist.githubusercontent.com151.101.184.133    cloud.githubusercontent.com151.101.184.133    camo.githubusercontent.com151.101.184.133    avatars0.githubusercontent.com199.232.68.133     avatars0.githubusercontent.com199.232.28.133     avatars1.githubusercontent.com151.101.184.133    avatars1.githubusercontent.com151.101.184.133    avatars2.githubusercontent.com199.232.28.133     avatars2.githubusercontent.com151.101.184.133    avatars3.githubusercontent.com199.232.68.133     avatars3.githubusercontent.com151.101.184.133    avatars4.githubusercontent.com199.232.68.133     avatars4.githubusercontent.com151.101.184.133    avatars5.githubusercontent.com199.232.68.133     avatars5.githubusercontent.com151.101.184.133    avatars6.githubusercontent.com199.232.68.133     avatars6.githubusercontent.com151.101.184.133    avatars7.githubusercontent.com199.232.68.133     avatars7.githubusercontent.com151.101.184.133    avatars8.githubusercontent.com199.232.68.133     avatars8.githubusercontent.com # GitHub End

但是增加了后发现,无法修改hosts文件,原因大概就是权限的问题。

在找到了比较方便的方法:

  1. 在随便什么位置新建hosts.txt文件。
  2. 把 C:\Windows\System32\drivers\etc 的 hosts 文件里的内容复制到这个hosts.txt文件中,然后进行自己想要的修改。
  3. 把 hosts.txt 的后缀去掉,因为 C:\Windows\System32\drivers\etc 里的 hosts 文件是没有后缀的。
  4. 把这个hosts文件放入 C:\Windows\System32\drivers\etc 中去覆盖原来的 hosts 文件,这样就大工告成啦~~
上一篇:10-01 Java语言基础(Eclipse的设置)
下一篇:09-03 Java语言基础(内部类)

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2025年03月20日 17时54分56秒