LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to reset root password (https://www.linuxquestions.org/questions/linux-server-73/how-to-reset-root-password-519611/)

bsisol 01-15-2007 06:01 PM

how to reset root password
 
I have lost my root password , how can I reset it?

puntjuh 01-15-2007 06:10 PM

Hi, there are a few ways to do this.


If you are using LILO as bootloader:

Type in 'linux single' and press 'Enter'. This will log you in as root in single-user mode. If your system requires you to enter your root password to log in, then try 'linux init=/bin/bash' instead.

When it has booted into single-user mode use: 'passwd'
to change the password. then just type: reboot or shutdown -r now
to reboot and the new password should be working.

If you are using grub as bootloader:

When ur in the bootloader, highlight whichever line you boot with and press 'e'. This brings u to a screen where you should highlight the line that starts with 'kernel' and press 'e' again.

Behind the line insert: 'single'

hit enter to save change.
and press 'b' to boot.

If this doesn't work place behind single: 'init=/bin/bash'

and once again use passwd to change the password and type reboot / shutdown -r now to reboot the system.

IF this doesn't work you could also try using a live cd such as knoppix!

ALL COMMANDS WITHOUT THE QUOTATIONS!


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