How Do I Edit Hosts Files? Lubuntu 20.04
Normally I Get a Access Denied Even After I Change It's Permission to 777. I See Many Solutions Use Gedit, Dunno How to Get Use or Find Whatever That Is. Other...
Normally I get a access denied even after I change it's permission to 777.
I see many solutions
Use gedit, dunno how to get use or find whatever that is.
Other solutions use the terminal sudo -i gedit /etc/hosts Sure but I don't know how to save a file from the terminal, CTRL+D does nothing.
Try sudo nano /etc/hosts I get: No such file or directory
Try the this program: hostsed but it is also denied me to save.
So how do I edit and save my hosts file?
1 Answer
First, backup your hosts file.
cp /etc/hosts ~/Desktop/hosts.ori
Then, mess up with it using sudo to get the right permission, follow by your choice of text editor, such as nano or vim.
sudo vim /etc/hosts
sudo nano /etc/hosts
hosts file modification can be dangerous as it allows to poison DNS queries with malicious servers. For example, a malicious actor may edit your hosts file to forward your passwords to their servers!! Play with it at your own risk.