View previous topic :: View next topic |
Author |
Message |
crouse Site Admin

Joined: 17 Apr 2025 Posts: 11833 Location: Iowa
|
Posted: Thu Apr 21, 2025 7:42 am Post subject: Recovering from a lost root password |
|
|
Ok.... it finally happened to me...... lol.
You'd think that I wouldn't forget it, but I lost my root password to my Mandrake box. Since it's in high security mode all the time, it asks me to change my password every so many days..... guess what, I forgot what I had changed it too last.
Luckily it's an easy fix if you have physical access to the machine.
Slax to the rescue
Using the live linux cd Slax, I loaded slax into the ram (so I could access the cd burner ). I proceeded to make a much needed backup from slax, as the bios on the computer was acting flakey and I didn't want to take the chance that I wouldn't get another chance !
After making my backups with k3b using Slax, I decided it was time to fix that pesky "I forgot the root password" thing.
Open a terminal window.
then do
and finally run
Which changes your root password on your hard drive..... pretty easy, and a quick way to remedy what is a very frustrating moment.
Now some would say this is a glaring security hole, no.... it isn't, that's why protecting the machine physically is VERY important. Securing the computer physically, is as important as it is to secure the network it's on. They go hand in hand.
The internet is filled with many ways to fix a lost root password mistake, but this one was the easiest one I've found to date.
Note to self.... I really need to turn off that uber security thing on mandrake 
_________________ Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
|
|
Back to top |
|
coastie Moderator Bot

Joined: 24 Apr 2025 Posts: 3064 Location: The Fox Den in the Big Easy
|
|
Back to top |
|
crouse Site Admin

Joined: 17 Apr 2025 Posts: 11833 Location: Iowa
|
|
Back to top |
|
coastie Moderator Bot

Joined: 24 Apr 2025 Posts: 3064 Location: The Fox Den in the Big Easy
|
Posted: Thu Apr 21, 2025 8:57 am Post subject: |
|
|
have you done the webconfig yet ?
_________________ Ubuntu on the thinkpad
Easy Peasy on the EEEPC
Desktop is down.
|
|
Back to top |
|
RootLinux Advanced Member

Joined: 04 Dec 2025 Posts: 940 Location: Tennessee
|
|
Back to top |
|
Germ Keeper of the BIG STICK

Joined: 30 Apr 2025 Posts: 12452 Location: Planet Earth
|
Posted: Thu Apr 21, 2025 10:42 am Post subject: |
|
|
1- boot to single user mode
2- passwd
3- set new password
4- good to go
_________________ Laptop: Mandriva 2025 PowerPack - 2.6.33.5-0.2mnb
Desktop: Mandriva 2025 Free - kernel 2.6.33.2-1mib
|
|
Back to top |
|
sasha Sr. Member

Joined: 05 Nov 2025 Posts: 1911 Location: Warsaw, Poland
|
Posted: Thu Apr 21, 2025 12:51 pm Post subject: |
|
|
Yes, if you take a look at the "Server Hacks" book that you have, there's a section that explains how to boot into a shell directly by throwing a simple command to the bootloader and mount hda1 writable to change the password. I have to find my old photocopies and take a look.
_________________ OpenSUSE 11.1 kernel: 2.6.27.7-9-pae
|
|
Back to top |
|
crouse Site Admin

Joined: 17 Apr 2025 Posts: 11833 Location: Iowa
|
|
Back to top |
|
Germ Keeper of the BIG STICK

Joined: 30 Apr 2025 Posts: 12452 Location: Planet Earth
|
Posted: Fri Apr 22, 2025 11:30 am Post subject: |
|
|
Very odd. I've booted MDK to single user before. What was the prob?
_________________ Laptop: Mandriva 2025 PowerPack - 2.6.33.5-0.2mnb
Desktop: Mandriva 2025 Free - kernel 2.6.33.2-1mib
|
|
Back to top |
|
crouse Site Admin

Joined: 17 Apr 2025 Posts: 11833 Location: Iowa
|
Posted: Fri Apr 22, 2025 5:16 pm Post subject: |
|
|
Didn't have the install disks, and using SEL on it too. No option on the boot manager would let me get to single user mode ..... which i thought was odd too. Maybe it's a part of SEL ...... don't know.
Quote: |
Single User Mode
Linux also provides two built-in rescue systems, one of them is the 'single user mode', aka runlevel 1. This 'single user' is 'root'. There will only be a minimum of processes running.
There are several ways to get into this runlevel:
*
From within a running system (as 'root'): init 1. Notice that this command will shutdown almost everything on your machine. It's also a popular way to simulate a reboot.
*
From the prompt of a boot loader: linux single or linux init 1. You might also be dropped off here when using the 'failsafe' boot option if the system can't go to runlevel 3.
There's no login required.
|
My problem was that
1. I didn't know the root password
2. I didn't have a prompt on the boot loader.......just a menu to select.
3. Booting failsafe always ended up with me in graphical mode as well...as it went to init 5.. (login screen).
Quote: |
'failsafe' is a standard boot option in all Mandrake Linux systems.
Under normal circumstances, the system switches right into the preferred runlevel during boot ('3' for console, '5' for X). 'failsafe' on the other hand first boots into runlevel 1 (Single User Mode, see below), then tries to switch to runlevel 3 (console) and then, if 5 is the default runlevel, into runlevel 5. |
.
.
.
.
I'm am SURE that there was probably an easier fix than what I did, but for the life of me i couldn't figure out what lol. Booting Slax and fixing it that way was the simplest thing I could think of.... worked slick too 
_________________ Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
|
|
Back to top |
|
geeshock Moderator

Joined: 02 Nov 2025 Posts: 1017 Location: Hertford, NC
|
|
Back to top |
|
smartcat99s Jr. Member

Joined: 19 Dec 2025 Posts: 66 Location: Omaha
|
Posted: Fri Apr 22, 2025 8:31 pm Post subject: |
|
|
sasha wrote: | Yes, if you take a look at the "Server Hacks" book that you have, there's a section that explains how to boot into a shell directly by throwing a simple command to the bootloader and mount hda1 writable to change the password. I have to find my old photocopies and take a look. |
I think that it would be adding
init=/bin/bash
and remount by using
mount /dev/hda1 / -o remount,rw
It's been a while since I've had to use this, so I may not be right.
_________________ Arch Linux - 2.6.28-blackice1 (custom based on git tree/tuxonice)
|
|
Back to top |
|
Germ Keeper of the BIG STICK

Joined: 30 Apr 2025 Posts: 12452 Location: Planet Earth
|
Posted: Fri Apr 22, 2025 11:18 pm Post subject: |
|
|
Quote: | 2. I didn't have a prompt on the boot loader.......just a menu to select. |
At the lilo splash, hit the "Esc" key. That takes you to a boot prompt. Type linux 1, hit "Enter".
_________________ Laptop: Mandriva 2025 PowerPack - 2.6.33.5-0.2mnb
Desktop: Mandriva 2025 Free - kernel 2.6.33.2-1mib
|
|
Back to top |
|
crouse Site Admin

Joined: 17 Apr 2025 Posts: 11833 Location: Iowa
|
|
Back to top |
|
mmmna . . . .

Joined: 21 Apr 2025 Posts: 7224
|
Posted: Sat Apr 23, 2025 10:19 am Post subject: |
|
|
I did this for the fun of it a couple years back; IIRC it went this way for me:
When you are at any prompt (knoppix from CD, a second distro on a different partition of the same hard disk, a boot floppy that can mount hard disks, etc.), and you are in a command environment that can mount and read and write your normal boot (hda1) partition, you only need a text editor and you can manually edit the /etc/passwords (/etc/passwd?) file, removing all the asterisks that come after the root entry. Save the file that you edited. Next time the system boots from the normal boot (hda1), just set a new password manually (issue the passwd command) if the system doesn't ask you to set a password.
_________________ -Kubuntu 10.04 LTS Beta2 on Celeron D desktop
-PCLinuxOS 2025 LXDE on EeePC 900A with Atom n270 (modded with 32G SATA drive and 2G ram).
|
|
Back to top |
|
|