LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 03-09-2004, 11:25 PM   #1
Schmurff
Member
 
Registered: Mar 2004
Location: Netherland
Distribution: Fedora Core 2, Mandrake10.0
Posts: 62

Rep: Reputation: 15
Angry Cannot login as root anymore


Hello everybody,

Suddenly, out of the blue, I can't login as root anymore. And, yes I have not forgotten my password, and indeed I have taken a close look at my CapsLock key.
Everything has been done right, login failed.
I can login as user and enter the su-mode, then the root-password is accepted.
My distribution is Mandrake 9.2, it runs about two weeks now.
Is there anybody else who has met this problem?

Schmurff
 
Old 03-09-2004, 11:30 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
I have never had it happen without knowing how (yes, I was stupid enough to change my root password and forget what I changed to it...). But I do know how to fix it As I always say, no computer you can sit at is safe...

Boot off a linux boot cd, any boot cd will do so long as it has support in it's kernel for your file system. Hell, even most distribution isntall CD's will do if you can get to a prompt. Mount your root partition. Go into /etc/shadow (assuming you have shadow passwords) and delete the bunch of characters between the first and 2nd : for the root user (aka you have something like this root:bunchofchars:number:number::::: delete the bunch of numbers which is the MD5 hash of your password).

Now your root password is null, just hit enter when prompted and you can log in.
 
Old 03-13-2004, 01:18 AM   #3
Nytehawk
LQ Newbie
 
Registered: Mar 2004
Location: Northern Virginia
Distribution: Fedora Core 2
Posts: 29

Rep: Reputation: 15
Actually, doing that leaves your system wide open until you establish a new password for root. Not a good idea.

Here's my suggestion: Reboot your machine into single user mode. From here, run the passwd command, and change the password for root. Then reboot again, and all is right in the world.

This way, you aren't mucking about with the /etc/shadow file directly.

Here's some info on a Mandrake grub.conf file. http://www.linuxquestions.org/questi...003/02/4/47467

You should be able to edit this from the splash screen when the machine first boots....you just gotta stop the timer.


Here's some more stuff about it. http://www.rajeevnet.com/linux/grub_serial_console.html
Scroll down this page until you see "Single User Mode Login:" and this explains how to boot your system into single user mode. Usually, you can just enter a 1 or s instead of the word single. This is for a Red Hat system, but GRUB should work similiarly cross platforms.

Oh...all of this stuff will only work from a physical console.

Last edited by Nytehawk; 03-13-2004 at 01:19 AM.
 
Old 03-13-2004, 04:07 PM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
Yes, it does, that is why you pull your network cable and set a password immediatly apon booting again, which maybe I mistaken thought was common sense.

Some Linux system require a password even for single user mode.
 
Old 03-15-2004, 07:16 AM   #5
karans
LQ Newbie
 
Registered: Oct 2003
Location: India
Distribution: Red Hat {9.0, 7.x , 6.x } , Mandrake 9.x
Posts: 19

Rep: Reputation: 0
Must say that the idea by Nytehawk is better and safer . If you have a boot-loader password , then my friend , your journey will be longer.
 
Old 03-15-2004, 10:00 PM   #6
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
All I am saying is many linux machines, mine including, require the root password to boot into single user mode, so Nytehawk's method won't work.

As long as you aren't stupid about it there is nothing wrong with editing /etc/shadow yourself. Don't be scared, it is just a text file.

But nytehawk is right, don't be stupid and boot onto a network with an empty root password... although if you really care about security I am sure you disabled root logins on all protocols you have open anyway like a good system admin always does.

In general it is always a good idea to get your root password set before you let anyone log in as any type of user on any protocol.
 
Old 03-16-2004, 12:59 AM   #7
Schmurff
Member
 
Registered: Mar 2004
Location: Netherland
Distribution: Fedora Core 2, Mandrake10.0
Posts: 62

Original Poster
Rep: Reputation: 15
Hello all of you,

It was with great interest that I read your replies. As I said, I felt uncomfortable about messing with my root-password.
Searching a bit more around, I found the following reason for the problem:

I have Mandrake 9.2. Just before this problem emerged, I increased the securitylevel from HIGH to HIGHER.
This alone was the reason, for one cannot directly login as root if the system is set to this securitylevel.
Decreasing the security to the old level enabled the good old direct root-login again.

Nevertheless, thanks to all of you for your wellmeant advices!

grtz,

Schmurff

Last edited by Schmurff; 03-16-2004 at 01:01 AM.
 
  


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
can't login as root anymore TranceDude Linux - Software 1 09-18-2005 06:08 PM
Unable to login anymore !! Is it x windows prems Linux - Newbie 2 03-01-2005 04:14 PM
cannot login to ssh anymore chadi Linux - General 12 11-18-2004 02:31 PM
Cannot login anymore all of a sudden... Worstje Linux - General 5 07-05-2004 02:22 AM
I can't login anymore! rcaldera Red Hat 4 12-23-2003 12:34 PM


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