1830933 Members
1928 Online
110017 Solutions
New Discussion

Re: forgot root password

 
juno3
Occasional Advisor

forgot root password

If forgot root password , how to get back the password ? thx.
12 REPLIES 12
Andy Kruta
New Member

Re: forgot root password

You have to boot into initlevel 1. This will load the system as root, but not load PAM, and thus allow you to change the root password.
Steven E. Protter
Exalted Contributor

Re: forgot root password

reboot your machine. Any user empowered to shutdown can do it. If nobody other than root can do so, use the power switch. Shut down any and all applications first.

At restart, interupt at the 10 second prompt

type bo
Y to interact with the ipl

hpux -is

After the system boots, passwd

You will be prompted twice.

If you have password protected single user mode then your only other viable option is to let crack run on your passwd file for a few days and hope it guesses it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: forgot root password

Disregard my post. I thought I was in HP-UX.

You can run crack on /etc/passwd that will eventually guess the password. Run it on a copy of the passwd file, not the original.

Beware that crack will use a ton of system resources.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
juno3
Occasional Advisor

Re: forgot root password

hi Andy ,

I use RH 9 , how to boot to level 1 ? thx.
Vitaly Karasik_1
Honored Contributor

Re: forgot root password

for GRUB boot-loader:

- press "e" when you see boot menu

- go to line with your kernel and press "e" again

- add 1 in the end of the line

- press "b" for boot


Vitaly
juno3
Occasional Advisor

Re: forgot root password

Thx VK, after I boot to the system , how can I know what run level it is ? thx.
Vitaly Karasik_1
Honored Contributor

Re: forgot root password

you can check it by


runlevel


commmand.

And if you have command prompt now, you can use


passwd


command in order to set new root password
kenny chia
Regular Advisor

Re: forgot root password

Hi
you can try this utility from this web site, assuming you have access to /etc/passwd

http://www.openwall.com/john/
All Your Bases Are Belong To Us!
Ralf Puchner
Honored Contributor

Re: forgot root password

why not booting Linux from CD or disk (e.g. Installation disk) and mounting the root filesystem from harddisk to /mnt, edit the /etc/passwd and reboot the system.

Voila, most of the linux distributions offers an emergency mode on the installation cd/disk.
And with such a disk it is fairly easy....
Help() { FirstReadManual(urgently); Go_to_it;; }
Ralf Puchner
Honored Contributor

Re: forgot root password

Use

who -r

to get the current runlevel.
Help() { FirstReadManual(urgently); Go_to_it;; }
Michael Creutz
Advisor

Re: forgot root password

1. Reboot the machine, i.e. do followed by

2. As it reboots watch for a message indicating which device is being used as the root device. On a machine I recently did this for it was /dev/hda6

3. Reboot the machine again using an installation disk, either floppy or CD. I use Debian, but the procedure should be similar for other distributions.

4. Proceed only through language selection and configuring the keyboard.

5. Press and activate a shell. Look for a message indicating what editor is available.

6. Mount the root device somewhere, i.e.
mount /dev/hda6 /mnt

7. cd /mnt/etc

8. Edit the file "shadow" (or passwd if not using shadow passwords). Remove the second field from the root line so it starts with "root" followed by two adjacent colons. Leave the rest of the line unchanged. Save the edited file.

9. Remove the installation disk and reboot again. Now root won't need a password.

10. Immediately log in as root and run the passwd command to give root a new password.



Ralf Puchner
Honored Contributor

Re: forgot root password

ok that's the conclusion of my posting in detail ;-)
Help() { FirstReadManual(urgently); Go_to_it;; }