5 August 2016

How To Reset Root Password on RHEL7&CentOS7 with Single User Mode


This case, you forgot password root account or anything, step by step like below:

1. Please Reboot Server, At the boot menu, press e to edit the existing kernel (Core) as shown
Redhat CentOS Grub 2 menu

2. Remove the rhgb quiet and add init=/bin/bash

3. After changing that, press Ctrl + X 


4. In the single user mode, run the command as shown below


mount | grep root
mount -o remount,rw /
mount | grep root 



5. Change password root account:
passwd



6. SELinux relabeling
touch /.autorelabel



7. Reboot System
exec /sbin/init



very easy...

No comments:

Post a Comment