Reset root password when unable to login in run level 3,5 plus single user mode

Posted on June 17, 2019

0


LAB ENVIRONMENT

RHEL = 7.6

Reset root password when unable to login in run level 3,5 plus also in Single user mode. You need to boot from redhat OS dvd and move towards > troubleshooting > rescue mode > readonly.

Second you need to run the following commands to mount the partition

chroot /mnt/sysimage

with partition you need to mount.

mount -o remount,rw /var/log/audit
mount -o remount,rw /

we can now change root password from rescue mode.

TIP

In our lab

– we were not able to login in normal user mode due to audit log partition was full (this audit setting cant be ignored either system needs to halt or suspend if audit logs are configured and become full).

– Furthermore single user mode was configured as password protected and in single user mode due to root password expired and that’s why we were not able to login.

– So we reached to a rescue prompt and run above mentioned command then we fixed the audit log rotation as mentioned below 🙂

max_log_file = 8
num_logs = 5
max_log_file_action = ROTATE
Posted in: Tech News