Resetting the root password requires you have access to the server console. For physical machines, console is the monitor or kvm plugged into the machine. For virtual machines, console is the virtual console provided with the type of virtual server.
Reset root password when you don’t already know it.
1. Restart RedHat Server
2. When server restarts, on Grub menu, select the current Kernel and type “e”.
3. Find the line that begins with linux16, and place rd.break enforcing=0, then CTRL + X to continue.
Note: rd.break asks for a break at an early stage of the boot process. enforcing=0 puts the system into SELinux Permissive mode. Don’t confuse with selinux=0 that completely disables SELinux.
4. At the switch_root:/# prompt, execute a “mount -o remount,rw /sysroot”
5. After remounting the sysroot, execute “chroot /sysroot”
6. Simply, execute a “passwd root” and change password.
7. Execute “exit” twice at command prompts to continue the booting of the system.
8. Login to server using newly created root password. Execute “restorecon /etc/shadow” and then reboot server. Password is now set.
This is the ultimate RHCSA Preparation course. Learn from a 25 year UNIX veteran, and not for courses but real world experience managing and operating Linux/Unix variants. We provide access to a real Redhat system to conduct practice exam. Absolutely NO other online course provides this type of service. Its…