echo-ing off during boot of RHEL7 to reset root password

Latest response

(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).

hey robert -
For full disclosure here, I have seen this problem mostly on Redhat recompilations (sorry, we're a community college and we just cant afford even the academic license fees), so I assumed it was a problem with that environment and we just worked around it (you can actually deal with the problem - input gets through, you just cant see it, and multi-line commands dont work (like passwd), but echoing the new password to passwd using --stdin does )
however last week the same problem occurred in a purely redhat controlled environment (i wont say more due to non-disclosure) and when i investigated further on our systems, removing the rhgb option from the kernel line worked.

I hadnt seent the solution to the VM issue on your site, and I havent even tested the bug on bare metal. I will do both this week, and I'll try it out on our reference redhat machines and get back to you when i have more details.

btw, the article reference usb keyboards. I think all our machines are still using old ps2 keyboards, but i'll check that too.

ok, i installed a rh7 VM on a rh7.1 host and experienced the same problems with echo-ing. The same solution worked: removing rhgb from the linux16 command-line at boot fixed it.

I'm not sure what particulars you want about the environment, but I can send you whatever you need.

I didn't try the rd.break solution, but this is far simpler, and you dont have to relabel the filesystem.

addendum: I tried the console=tty0 solution. No change.

Thank you for opening this discussion and posting where the problem is, Greg. I'll mention that rhgb might cause this in the RHEL 7.1 Installation Guide.