Can't get into sudo - HELP!

Ed Smits ed.smits at gmail.com
Sat Nov 18 04:25:47 UTC 2006


Just figured it for myself, same basic route as you say - booted the
Live CD, mounted my root partition, edited the hosts file so that the
first line reads correctly, rebooted and everything works, was able to
enable my WiFi card and get to work.

Many thanks. I was afraid I'd have to go in to the office in the
middle of the night to fix this.

Cheers


ED

2006/11/17, Sarangan Thuraisingham/சாரங்கன் துரைசிங்கம்
<sarangan.thuraisingham at gmail.com>:
> On Fri, 2006-11-17 at 22:24 -0500, Ed Smits wrote:
> > I'm a relatively new UBUNTU user, using Dapper. My laptop has a NIC
> > and a WiFi card, both work. NIC is set for fixed IP at the office,
> > WiFi is set for DHCP. I haven't yet figured out hardware profiles, so
> > my solution has been to disable the WiFi at work and reverse this at
> > home.
> >
> > Got home today, turned on the laptop, took forever to boot. Tried to
> > start the Network app to switch to the WiFi card, nothing happened.
> > After many false starts I opened a terminal and tried to run something
> > as sudo, got the following error:
> >
> > sudo: unable to lookup hostname via gethostbyname()
> >
> > hostname being my correct unqualified hostname.
> >
> > I opened my hosts file and see only 2 entries (besides the IPv6 ones)
> >
> > 127.0.0.1 localhost localhost
> > 127.0.1.1 hostname.domain.com
> >
> > Having more experience with Fedora (but not much more) I figured no
> > big deal, I'll log in as root and fix this, of course I don't have
> > root logins enabled...
> >
> > I went to the rootsudo FAQ at Ubuntu, tried to follow their suggestion
> > to go to another terminal window, log in as myself, do a sudo -i and
> > then startx -- :1 to get a graphical login as root so I could fix my
> > problem. No go, same gethostbyname error when I sudo.
> >
> > Questions:
> > 1) how do I get in to my system without going back to the office where
> > I assume the problem will not affect me
> if you want root access you can also try starting in  recovery mode. To
> do that, when you start your laptop, in your grub menu choose the entry
> with the recovery option. For example I am running Edgy and I would
> choose "Ubuntu, kernel 2.6.15-27-386 (recovery)" to start in recovery
> mode.
>
> > 2) what should my hosts file contain if that is the problem?
>
> My host file:
> saru at saru-laptop:~$ cat /etc/hosts
> 127.0.0.1 localhost saru-laptop
> 127.0.1.1 saru-laptop
>
> 152.78.71.148 servalan servalan.ecs.soton.ac.uk uglogin
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> ff02::3 ip6-allhosts
>
> Your computer is called something other than localhost right? Because
> accoriding to your hosts file, gethostname for (127.0.0.1) will return
> localhost. In my case it will return "saru-laptop".
>
> --
> Saru
> ECS, University of Southampton, UK
>
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>


More information about the ubuntu-users mailing list