Adding or editing an entry in /etc/hosts

William Stephens wstephens10 at cox.net
Sat Jan 6 15:22:28 UTC 2007


On Sat, 2007-01-06 at 09:37 -0500, Brian Lunergan wrote:
> Rebel Lion wrote:
> >  See what ifconfig tells you, you shouldn't need sudo for that, you are going 
> > to have hassles trying to edit the hosts file though because you need to be 
> > sudo to do it. You are probably going to have to login in recovery mode to 
> > fix it.
> > 
> 
> That's the direction I went. Started up in recovery mode through grub, logged in 
> as root, and cd /etc to drop into the directory. That's where I'm stuck for the 
> moment. Using gedit in the gnome desktop is easy enough (if I weren't locked out 
> in read only for not being the owner in that environment) but I'm still too much 
> of a neophyte to know what command I use to open and edit the hosts file from 
> the command line as root.
> 
> Thoughts??
> 

Hi,

sudo vim hosts

vim is my preferred text editor, if your not familiar with vim type
vimtutor at command line.

William S.  





More information about the ubuntu-users mailing list