LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   root password (https://www.linuxquestions.org/questions/linux-general-1/root-password-368516/)

a4syed 09-30-2005 12:56 PM

root password
 
Hi, I have forgotten my root password... is there any possible way to recover it???

acid_kewpie 09-30-2005 01:04 PM

on your bootloader screen you need to boot run runlevel 1. if this is grub hit e for a prompt and just add "1" or "single" to the boot command, or do the same thing in lilo, normally by hitting escape for a prompt and runnign "linux single" or suitable equivalent for your system. this will log you in as root.

a4syed 10-01-2005 11:34 AM

Thanks for your prompt reply but this method of starting in single mode of my OS (SUSE 9.3 pro) using the 1 or single command takes me straight to the prompt that requests the root password still....



bootsplash: status on consol 0 changed to on
Master resource Control: runlevel S has been
give root password for login:

acid_kewpie 10-01-2005 12:53 PM

you're not doing it right then! single user mode, runlevel 1 will NOT request a password.

a4syed 10-01-2005 01:32 PM

hmmm the instructions you provided were not so complicated :S anyways i guess ill have to reinstall mayb ill install fedora this time cuz suse pro has some hardware detection probs in my laptop. Thanks for ur help though.


raza

Ahmed 10-01-2005 02:34 PM

Check out the /etc/inittab file. Search for something like this:

Code:

# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

This is the Knoppix inttab file. Check which runlevel is the single user one and switch to that. The runlevels are sometimes distro-specific (Runlevel 5 on Fedora is the same as Runlevel 4 on Slackware. Runlevel 4 on Fedora does nothing)

-A

btmiller 10-01-2005 03:49 PM

And BTW single user mode can be configured to require that the root password be required for entry (for extra security). IIRC this is the default on Red Hat systems (not sure about SuSE). Rather annoying IMHO. Anyhow, no need to reinstall, follow the following procedure:

1) Boot off of a LiveCD or your distro's rescue CD
2) Mount your root filesystem
3) Edit your root filesystem's /etc/shadow and remove root's encrypted password. (2ns field of /etc/shadow, just leave nothing there).
4) When you reboot, root will be able to login with no password. Rectify this insecure situation immediately.

a4syed 10-01-2005 07:04 PM

Wew you guys are so kewl and helpful.... but dym im installing debian as we speak.... suse was giving a hard time with my toshiba wireless card... and when the password problem came i finally gave up hope for the distribution and decided to use a more widely used distro.... o. im now loging in to the new distro so c ya all l8ter. once again thanks for the help


All times are GMT -5. The time now is 09:09 AM.