Linux reset forgotten root password
Q. I forgot my root password, how can I get into my system?
A. You can reset forgotten root password under Linux by booting system into single user mode or emergency mode (also known as rescue mode).
My boot loader is GRUB (see LILO boot loader below)
)Following is the procedure to reset root password if you are using GRUB as a boot loader:
- Select the kernel
- Press the e key to edit the entry
- Select second line (the line starting with the word kernel)
- Press the e key to edit kernel entry so that you can append single user mode
- Append the letter S (or word Single) to the end of the (kernel) line
- Press ENTER key
- Now press the b key to boot the Linux kernel into single user mode
- At prompt type passwd command to reset password:
You need to mount at least / and other partitions:
# mount -t proc proc /proc
# mount -o remount,rw /
Change the root password, enter:
# passwd
Finally reboot system:
# sync
# reboot
My boot loader is LILO
At LILO boot loader type linux single and press [ENTER] key:
Boot: linux single
When you get the # prompt you will need to type passwd root to reset password:
# passwd
Reboot system:
# sync
# reboot
See also:
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Default username created during a new installation of Linux?
- What is My root Password for MySQL Database Server?
- Linux: Resetting a user’s password
- How To Reset Linux Firewall Automatically While Testing Configuration With Remote Server Over SSH Session
- Linux set or change user password how to
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: boot_loader, emergency_mode, forgotten_root_password, grub, Linux, mount_command, passwd_command, reboot_command, rescue_mode, reset_root_password, single_user_mode



December 14th, 2006 at 5:03 am
thanks for useful trick because many time it happens that you forget password
August 11th, 2007 at 11:46 am
i want password releated information
November 15th, 2007 at 3:49 am
how to reset root password
December 25th, 2007 at 3:12 pm
thxu very much for help
March 13th, 2008 at 3:25 am
Very helpful indeed. Manage to reset now.