1

I cannot open my /etc/hosts file. I would very much like to, I have tried logging in as root and changing the ownership and changing the permissions, please help.

When I try to open the file I get:

-bash: /etc/hosts: permission denied
Eliah Kagan
  • 119,640
Seb
  • 11

2 Answers2

3

Open a terminal and run the following command...

gksudo gedit /etc/hosts

This will open the file in gedit with root privileges allowing you to make your changes.

Cheesemill
  • 1,007
-1

In the terminal type:

$  sudo su

Type your password...

And you will get the root privileges. Then open the file via any text editor:

By GEdit

#  gedit /etc/hosts

By mousepad ( sudo apt-get install mousepad )

#  mousepad /etc/hosts