Comments on: Single User Mode: Resetting/Recovering Forgotten Root User Account Password in RHEL/CentOS 7 https://www.tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Mon, 27 Jul 2020 13:04:48 +0000 hourly 1 By: Bob O'shea https://www.tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/comment-page-1/#comment-1348095 Mon, 27 Jul 2020 13:04:48 +0000 http://www.tecmint.com/?p=12095#comment-1348095 In reply to Rudra M.

Try running the command “authconfig --updateall” at root shell in single/maintenance/emergency mode. Should fix the issue

]]>
By: Bob O'shea https://www.tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/comment-page-1/#comment-1348094 Mon, 27 Jul 2020 13:01:18 +0000 http://www.tecmint.com/?p=12095#comment-1348094 In reply to Ravi Saive.

So I did mount read and write, etc. But every time I got to reset the password, I would get “permission denied“. But I finally figured out the fix: when you get to root shell, run the command “authconfig --updateall” and all PAM config auth files and other functions that are called up by the /etc/pam.d/ config files will be recreated.

Removing whatever hardened lockdown restriction was applied that locked you out, to begin with. I wasted 20 hrs working on this stupid issue. Hope this works for someone else who can’t change the root password in single-user mode or emergency mode.

]]>
By: Ravi Saive https://www.tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/comment-page-1/#comment-1347405 Sat, 25 Jul 2020 04:39:10 +0000 http://www.tecmint.com/?p=12095#comment-1347405 In reply to Bob O’shea.

@Bob,

Have you mounted your root filesytem in read/write mode? if not do:

# mount -o remount,rw /

Or edit the kernel booting options, change ro init=/sysroot/bin/sh to rw init=/sysroot/bin/sh and boot your system and run these commands:

chroot /sysroot
passwd root
touch /.autorelabel
reboot

You now should be able to loggin as root user.

]]>
By: Bob O'shea https://www.tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/comment-page-1/#comment-1347254 Fri, 24 Jul 2020 15:55:42 +0000 http://www.tecmint.com/?p=12095#comment-1347254 After successfully getting into single user mode and getting to root shell, I type command “passwd” to reset the root password and I receive

"changing password for user root."
"passwd: permission denied"

Selinux is disabled, FIPS mode off, I’ve tried to figure out why this is happening to my server all of the sudden and cannot log into it anymore with any account.

]]>
By: Rudra M https://www.tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/comment-page-1/#comment-1329460 Fri, 24 Apr 2020 05:37:24 +0000 http://www.tecmint.com/?p=12095#comment-1329460 I have tried above steps but it didn’t work, still not taking a new password that I have set through the above steps. Please suggest how to resolve this?

]]>