Can't get into sudo - HELP!
Sarangan Thuraisingham/சாரங்கன் துரைசிங்கம்
sarangan.thuraisingham at gmail.com
Sat Nov 18 04:07:04 UTC 2006
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
> 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.
> 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
> 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
184.108.40.206 servalan servalan.ecs.soton.ac.uk uglogin
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
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".
ECS, University of Southampton, UK
More information about the ubuntu-users