Forum breadcrumbs – You are here:Tracston Community Forum – DevOps, Micro Services, Cloud, Infrastructure, Development, Monitoring and more…System: LinuxReset Root Password – CentOS / Re …
You need to log in to create posts and topics.
Reset Root Password – CentOS / Redhat – 6.x / 7.x
moshe@moshe
#1 · 23/10/2020, 4:55 pm
Quote from moshe on 23/10/2020, 4:55 pmProblem
User wants to reset root password without old password available
Solution
- Reboot your computer / Turn your computer on.
- Hold down the Shift key at the start of the boot process to enable the GNU GRUB boot menu (if it does not show)
- Press ESC at the GNU GRUB prompt.
- Press e for edit.
- Use the Arrow keys to highlight the line that begins with kernel and press the e key.
- Go to the very end of the line and add rw init=/bin/bash
- Press Enter and then press b to boot your system.
- Your system will boot up to a passwordless root shell.
- Type in passwd yourusername
- Set your new password.
- Restart your system.
Problem
User wants to reset root password without old password available
Solution
- Reboot your computer / Turn your computer on.
- Hold down the Shift key at the start of the boot process to enable the GNU GRUB boot menu (if it does not show)
- Press ESC at the GNU GRUB prompt.
- Press e for edit.
- Use the Arrow keys to highlight the line that begins with kernel and press the e key.
- Go to the very end of the line and add rw init=/bin/bash
- Press Enter and then press b to boot your system.
- Your system will boot up to a passwordless root shell.
- Type in passwd yourusername
- Set your new password.
- Restart your system.
Click for thumbs down.0Click for thumbs up.0