logoalt Hacker News

simonciontoday at 1:08 AM1 replyview on HN

> This is honestly the command I ran

Mmm. Unless your /etc/hosts is wide open or your shell is running as root, you got something like

  -bash: /etc/hosts: Permission denied
because the way to do what you intended is to sudo 'tee' or something similar in function. AFAIK, you can't 'sudo' shell redirection.

Replies

frollogastontoday at 1:30 AM

Yeah I actually ran it as root without the sudo then edited in the sudo, other comment with tee was correct

show 1 reply