LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 09-26-2010, 09:28 AM   #1
aurora72
Member
 
Registered: Jul 2009
Location: Türkiye
Distribution: Ubuntu 9.04 on IBM R31 thinkpad 512MB RAM shared VideoRAM, Intel i915 Graphics card 120GB HDD
Posts: 50

Rep: Reputation: 15
Cannot login as root


Hello,

Several months ago I installed Ubuntu 9.04 to my Laptop and now I've forgetten the root user's password (which I myself set!) therefore I cannot login as root.

I remember arranging one more user (in addition to the root user) and I do remember that user and its password, but it's only a normal user I don't know how exactly you call it, desktop user, power user, etc.

Anyway... when I log in as that normal user and try this:

Code:
$ sudo -i
it says it's not in the sudoer's list (and that my attempt will be reported).

The problem is, I cannot exactly remember the root users User Name (UN) either, nor the Password (PW). I 'm likely to remember the PW better than remembering the correct combination of UN & PW, that's why I tried to sudo -i from the normal user's account, i.e. with the hope of having a chance to enter only the root PW, not the combination of root UN & PW.

So I wonder what can I do now. I don't wanna re-install Ubuntu all over, is there a quick solution to this? Any comments and links to solution are appreciated, thanks.
 
Old 09-26-2010, 09:33 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
Boot from a live cd, 'chroot' into the disk installation and type 'passwd' as root.

or:

Boot to single user mode (if roots password isn't required) delete the password hash from /etc/shadow

The first method is cleaner

cheers
 
Old 09-26-2010, 10:06 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,245

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Whilst kbp's suggestions will work just fine I am a little confused as the installation of Ubuntu by default does not create a root password.
Or is your 'root user' the initial user, who is in the sudo list, that you are required to create?
 
1 members found this post helpful.
Old 09-26-2010, 10:33 AM   #4
LouRobytes
Member
 
Registered: Mar 2010
Location: Nova Scotia, Canada
Distribution: Ubuntu & Fedora
Posts: 189

Rep: Reputation: 44
I concur with grail. Unless you specifically ran "sudo passwd" after the install, root password will not be set. If not, do it.

Cheers, Lou
 
1 members found this post helpful.
Old 09-26-2010, 02:10 PM   #5
aurora72
Member
 
Registered: Jul 2009
Location: Türkiye
Distribution: Ubuntu 9.04 on IBM R31 thinkpad 512MB RAM shared VideoRAM, Intel i915 Graphics card 120GB HDD
Posts: 50

Original Poster
Rep: Reputation: 15
Thank you for the guidance. After continually using the Mac OS X for the last 4 months, I'm glad to get back to Linux on my laptop.

Booting to single user mode and then setting root password by #passwd has allowed me to set the root password. Then I've logged in again in single user mode and examined the /etc/shadow file. There I spotted the user name which I 've forgotten and that was it, later I easily logged in with that user name, because I knew the password.

The problem was basically that I had forgotten user name of that specific user... and now it's ok. It's very fortunate that Linux permits setting root PW in so-called the single user mode.

Many thanks!
 
Old 09-26-2010, 09:17 PM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,245

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Glad you got a solution, please mark as SOLVED.
 
  


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
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 05:27 PM
wrong login shell prevent root login cefs99 Linux - Security 4 05-31-2006 09:28 AM
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 04:44 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 12:39 PM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-06-2004 12:40 AM


All times are GMT -5. The time now is 02:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration