LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-30-2008, 06:39 AM   #1
edgjerp
Member
 
Registered: Dec 2004
Location: Trondheim, Norway
Distribution: kubuntu 10.04
Posts: 308

Rep: Reputation: 31
sudo fails due to hostname


I just upgraded to hardy, and now anything I try to do using sudo returns "sudo: unable to resolve host <myhostname>" this makes configuring my system a little complicated...
 
Old 04-30-2008, 07:00 AM   #2
edgjerp
Member
 
Registered: Dec 2004
Location: Trondheim, Norway
Distribution: kubuntu 10.04
Posts: 308

Original Poster
Rep: Reputation: 31
I found part of the problem, home is not mounted properly. but without access to sudo, I cannot do so.

Another thread said to change hostname to localhost, but I do not know how to do that without sudo privilegies.

Last edited by edgjerp; 04-30-2008 at 08:48 AM. Reason: more info
 
Old 05-04-2008, 01:01 AM   #3
Rick485
Member
 
Registered: Sep 2003
Location: Arizona
Distribution: Kubuntu 8.04
Posts: 202

Rep: Reputation: 30
I had the same problem. I had done a fresh clean install of the AMD-64 alternate install version of Ubuntu 8.04 on one partition, while keeping my old copy of Kubuntu 7.10 untouched on another partition for safe keeping. Sudo was still working fine at that point and for several days afterwards.

Here is how I had my system configured when it was still working properly. I installed Ubuntu 8.04 and then used Synaptic to also install the Kubuntu-desktop package. With Kubuntu also installed, I then switched to using KDE, by default, whenever I booted up. I have always done it that way, so that I would have access to several of my favorite Gnome programs and utilities while using KDE. Sudo was still working properly at that point.

The only problem that I had encountered so far was that when running the Firestarter firewall, it would sometimes totally freeze up and had to be terminated. However, that mostly only occurred shortly after having clicked the "Lock Firewall" icon. I had installed Firestarter despite already having a firewall built into my DSL router.

So anyway, I was attempting to figure out how to connect to a shared folder on my other Ubuntu/Kubuntu 8.04 computer, when I suddenly discovered that sudo was not working. Here is the error message:

sudo: unable to resolve host hedgehog

In the above error message, hedgehog is the host name of my computer. So today, I saw your post and the other post which suggested changing the host name of my PC to localhost. While still in KDE, I clicked on the Network option within the System menu, and a "Network Settings" utility appeared. All of the options were grayed out, so clicked on the "Unlock button" and entered my password. I was then able to change my host name to localhost. I logged out and back in and now sudo is working once again.

Since I have a hybrid Ubuntu/Kubuntu system, I am not sure if the above GUI type Nework tool is from the normal Kubuntu installation or from the Ubuntu installation or both. I am not sure if that same exact utility would installed on your normal Ubuntu system under Gnome or not. But anyway, sudo is now working properly for me. Fortunately, when sudo had quit working, the GUI tools for configuring network settings were still able to ask for my password and work properly.
 
Old 05-04-2008, 04:05 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have you tried booting from a live CD and fixing fstab?
 
Old 05-04-2008, 04:50 AM   #5
Rick485
Member
 
Registered: Sep 2003
Location: Arizona
Distribution: Kubuntu 8.04
Posts: 202

Rep: Reputation: 30
I just found out that Ubuntu Forums has several good discussions about this same problem. They have been saying that the problem is an entry in the hosts file which is located in the /etc/ folder. They have had to manually edit their hosts file to fix the problem. Here is one of those discussions:

http://ubuntuforums.org/showthread.php?t=723361

Billmayday's suggestion to boot from a live CD to fix the problem sounds like one good way to do that. Bill, did you mistakenly say the fstab file instead of the hosts file? I sometimes forget which is which.

He could boot a live Linux CD and then mount the partition. When doing it that way, a person needs to remember to not edit the /etc/hosts file on the live CD. Instead, they need to edit the hosts file in the etc folder of the partition that Ubuntu is on their hard drive instead.
 
Old 05-04-2008, 04:36 PM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Bill, did you mistakenly say the fstab file instead of the hosts file? I sometimes forget which is which.
No, but I'm not familiar with the specific problem so I took a guess based on a mounting problem. I'd assume that your solution is correct since it's based on rather more research than mine
 
Old 05-05-2008, 12:51 AM   #7
Viną
LQ Newbie
 
Registered: Mar 2006
Location: Indianapolis
Distribution: Ubuntu 10.10
Posts: 25

Rep: Reputation: 15
I've read the linked posts, rebooted to root & used nano to enter the appropriate lines into my /etc/hosts file, attempted to delete /var/run/sudo/* (nonexistent), can't get gksudo to do anything, my su password comes back "Authentication failure," and I don't have an "Administration" entry in my K > System menu.

Anybody see what I've done wrong or know of anything else?

I think I'm swearing off the *.04 releases after this. I can wait for NTFS -rw support.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFSd fails to start due to RPC? TexasDex Linux - Software 10 03-23-2010 02:02 AM
Unable to Run sudo due to getresuid() Not Working on CentOS 3.1 Xyrael Linux - Security 14 02-06-2008 08:29 PM
lighttpd fails due to installation in different directories i.you Linux - Software 0 03-07-2007 03:30 AM
Ubuntu 6.06 - changed /etc/hostname and now sudo is not working. morrolan Linux - Newbie 3 06-01-2006 04:10 PM
changed hostname: now sudo and xhost gone goofy iggymac Linux - Networking 2 06-13-2002 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration