LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-01-2006, 01:02 PM   #1
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Distribution: Frustrated Ubuntu 6.10 Edgy User
Posts: 257

Rep: Reputation: 30
Ubuntu 6.06 - changed /etc/hostname and now sudo is not working.


Hi guys.

I did something really stupid and changed /etc/hostname whilst in GNOME, rebooted and now I have no administrator functionality as sudo is crippled. I'm running Dapper BETA.

If I enter hostname at the command prompt, I get the following:

Code:
me@(none):~$ hostname
(none)
me@(none):~$
All of the other hostname switches return the same value. uname -n is the same.

If I try and use sudo at the command prompt, I get:

Code:
me@(none):/etc$ sudo vi hostname
sudo: unable to lookup (none) via gethostbyname()
me@(none):/etc$
I think it has something to do with an invalid hostname, which was -~me~-

I don't think it likes the tilde's.

Is there a way I can reboot at init 1 WITHOUT requiring superuser access? I know with GRUB before on Hoary I could add "init 1" or whatever it was to the kernel boot line, but there isn't that option to get into GRUB anymore.

Many thanks in advance,
Morrolan
 
Old 06-01-2006, 02:42 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,000
Blog Entries: 11

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
You can still pass init 1 as a command-line option in grub.

If that doesn't work (that is, if it prompts you for a login
on that runlevel [which it should if it's half-way sane]) you
can use init=/bin/bash
then mount -o remount,rw / and edit any file you please.




Cheers,
Tink
 
Old 06-01-2006, 04:10 PM   #3
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Distribution: Frustrated Ubuntu 6.10 Edgy User
Posts: 257

Original Poster
Rep: Reputation: 30
Thanks for that, I fixed it on the train on the way home - GRUB only gives you about a second to select to enter the menu so I must've missed that.

Anyway, I booted from my 6.06 live CD, mounted my / partition as rw, and then edited the /etc/hostname file that way.

Works a charm!
 
Old 06-01-2006, 05:10 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,000
Blog Entries: 11

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
Cool - congratulations! :}

Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Knoppix Changed Hostname deadlove75 Linux - Software 4 04-10-2006 01:15 PM
hostname changed - why? greg108 Fedora 3 12-31-2004 08:41 PM
hostname changed. was i hacked???????? Sridhar Guntur Linux - Networking 7 07-23-2004 12:34 PM
changed hostname now problems degraffenried13 Linux - General 2 02-21-2004 07:15 PM
changed hostname: now sudo and xhost gone goofy iggymac Linux - Networking 2 06-13-2002 11:25 AM


All times are GMT -5. The time now is 12:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration