Difference between revisions of "CentOS 8.x reset root password using grub and single user mode"
From Notes_Wiki
(Created page with "<yambe:breadcrumb self="reset root password using grub and single user mode">CentOS 8.x System Administration|System Administration</yambe:breadcrumb> =CentOS 8.x reset root p...") |
m |
||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 8.x]] > [[CentOS 8.x System Administration|System Administration]] > [[CentOS 8.x reset root password using grub and single user mode]] | |||
To reset root password in CentOS 8.x machine use: | To reset root password in CentOS 8.x machine use: | ||
Line 29: | Line 28: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 8.x]] > [[CentOS 8.x System Administration|System Administration]] > [[CentOS 8.x reset root password using grub and single user mode]] |
Latest revision as of 03:28, 19 April 2022
Home > CentOS > CentOS 8.x > System Administration > CentOS 8.x reset root password using grub and single user mode
To reset root password in CentOS 8.x machine use:
- Press 'up' or 'down' arrow key to stop booting at grub. Note that right arrow, space bar, enter etc. will cause grub to boot using selected menu item.
- Edit the line starting with linux and replace 'ro' with 'rw init=/sysroot/bin/sh'
- Boot into single mode using 'Ctrl + X ' shortcut
- Use following command to mount root filesystem at /
- chroot /sysroot/
- Change the password using:
- passwd root
- If SELinux is enabled then use
- touch /.autorelabel
- Restart the machine
- shutdown -r now
Refer:
Home > CentOS > CentOS 8.x > System Administration > CentOS 8.x reset root password using grub and single user mode