Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-bash: /etc/hosts: Permission denied #191

Closed
Zhonglu opened this issue Mar 29, 2023 · 5 comments
Closed

-bash: /etc/hosts: Permission denied #191

Zhonglu opened this issue Mar 29, 2023 · 5 comments

Comments

@Zhonglu
Copy link
Contributor

Zhonglu commented Mar 29, 2023

你好,

在WSL ubuntu20.04 中使用如下命令:
sudo sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts

提示错误:
-bash: /etc/hosts: Permission denied


@cxwx
Copy link

cxwx commented Mar 29, 2023

Permission denied

sudo  sed -i .....

@Zhonglu
Copy link
Contributor Author

Zhonglu commented Mar 29, 2023

sudo 之后仍然 permission denied,以上是sudo后的结果

@LQYHYQ
Copy link

LQYHYQ commented Mar 30, 2023

sudo -i,切换到root用户下,再执行命令sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts就可以了

@Zhonglu
Copy link
Contributor Author

Zhonglu commented Apr 4, 2023

可以了 多谢!

@Zhonglu Zhonglu closed this as completed Apr 4, 2023
@taotieren
Copy link

可以使用 systemd 方式来管理:#212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants