echo-ing off during boot of RHEL7 to reset root password
(As I prepared to post this, I discovered the problem, so I answered my own question. The information may be of interest to readers anyway, as it caused me no end of grief...)
When I boot and set init=/bin/sh to reset the root password, echoing is mysteriously turned off. This makes entering commands extremely tedious, though possible. (To make it worse, on some systems the first character of each command gets lost, and must be doubled to enter the command correctly.) I tried to turn echo-ing on in the root shell using stty echo, but bash is unable to reset parameters on stdin during boot.
The experience I have had is only on VMs - I haven't tried to see if this problem exists on bare metal, but I assume it does.
The answer lies in the rhgb keyword on the kernel command-line. Evidently this sets up stdin to not echo, and when bash starts, you're in trouble. Deleting the rhgb keyword from the command line before boot solved the problem.
This should be in the Installation Guide sec 28.1.3, but it isn't
Responses
Hi Greg,
Thanks for sharing this. Could you please describe your set-up a little more? We're aware that sometimes, VMs can cause trouble with password recovery (see the second part of this solution: Resetting the Root Password of RHEL-7 / systemd), but I haven't heard of this particular problem before.
In some (VM) cases, there may be a problem with the output being sent to a serial console (which cannot be seen in a VM environment -- this can be solved either by adding the console=tty0 kernel parameter, or by removing console=ttySn,baudrate).
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
