LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 12:02 PM   #1
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Posts: 264

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, 01:42 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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, 03:10 PM   #3
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Posts: 264

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, 04:10 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

Cheers,
Tink
 
  


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

All times are GMT -5. The time now is 06:40 PM.

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