archive mirror
 help / color / mirror / Atom feed
* Update phosphor-defaults with stronger root password hash algorithm
@ 2021-07-01 14:42 Joseph Reynolds
  0 siblings, 0 replies; only message in thread
From: Joseph Reynolds @ 2021-07-01 14:42 UTC (permalink / raw)
  To: openbmc

OpenBMC Community,

Testing the [libpam_1.5.1 changes][] revealed a limitation with the old 
MD5 hash algorithm used to encode OpenBMC's root password.  The fix is 
to change phosphor-defaults to use an acceptable hash algorithm such as 
SHA-512.  We can keep the same password so our testing tools continue to 
work.  Details are below.  I plan to push a fix for this.

- Joseph


OpenBMC provisions the BMC firmware image with the root account password 
in a form which is no longer acceptable to Linux-PAM version 1.5.1.

Specifically, [][] sets the password hash into 
/etc/shadow as "\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/", where $1 
indicates the old weak MD5 hash algorithm.  Ref: [wikipedia passwd 
entry][].  Beginning around PAM version 1.5.1, when you log in, the 
[ module][] authenticates okay but requires the password to 
be changed.  (For example, you'll get a message like "You are required 
to change your password immediately (administrator enforced)."  This 
behavior is undesirable for the OpenBMC project defaults, and is not 
tolerated by the project's current continuous integration tools.)  Note 
the new password is stored using the SHA-512 algorithm.   Thanks to Noah 
Brewer for debugging this issue.

This has an easy fix: use the same password with an updated hash 
algorithm.  Specifically, update the password hash supplied in to use the same password as before but encoded 
with the SHA-512 algorithm.  An acceptable hash can be provided by the 
`openssl passwd -6 0penBmc` command.  This change ought to be 
transparent, forward and backward compatible.  This change is also a 
prerequisite for going to libpam_1.5.1 (presuming you don't want to 
force users to change their password the first time they login).

Note various meta-layers use this same old hash string in 
conf/local.conf.sample files. They should consider updating to match the 
new value.

Closely related: the [Replace deprecated Linux-PAM modules][] gerrit review.

[libpam_1.5.1 changes]:

[wikipedia passwd entry]:
[ module]:
[Replace deprecated Linux-PAM modules]:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-01 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 14:42 Update phosphor-defaults with stronger root password hash algorithm Joseph Reynolds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).