Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
How to reset root passwords on rhel 7 and cent os 7 linux systems
1. Howto Reset Root Passwords on RHEL 7 and CentOS 7 Linux Systems
If you have forgotten your root password on a Red Hat Enterprise Linux 7 server you can reset your root
password as long as you have access to the GRUB 2 bootloader. (The following example was performed
on a OL7 server)
press "e" to edit.
Find line beginning linux
Find the line beginning with linux. In this example the line begins linux16.
2. Using the arrow keys and the delete key, manually delete the following entries rhgb and quiet from the
line.
Next, in the end of the line add this init=/bin/sh
press the keys Ctrl +X to reboot
- Load the installed SELinux policy: /usr/sbin/load_policy -i
- Remount the "/" root filesystem in Read/Write mode: mount -o remount,rw /
- Using command passwd to change your new root password
- Remount the "/" root filesystem in Read Only mode: mount -o remount,ro /
- Using this command to reboot server
#exec /sbin/init 6