From: Joseph Reynolds <jrey@linux.ibm.com>
To: openbmc <openbmc@lists.ozlabs.org>
Subject: Update phosphor-defaults with stronger root password hash algorithm
Date: Thu, 1 Jul 2021 09:42:54 -0500 [thread overview]
Message-ID: <34f5b89a-3919-e214-a744-4277fba0bbbb@linux.ibm.com> (raw)
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
Details:
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, [phosphor-defaults.inc][] 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
[pam_unix.so 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
phosphor-defaults.inc 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.
References:
[libpam_1.5.1 changes]:
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/41294
[phosphor-defaults.inc]:
https://github.com/openbmc/openbmc/blob/1a977b269ed437bebb9ae7810e3157746ec9174d/meta-phosphor/conf/distro/include/phosphor-defaults.inc#L245
[wikipedia passwd entry]: https://en.wikipedia.org/wiki/Passwd
[pam_unix.so module]:
https://github.com/linux-pam/linux-pam/tree/master/modules/pam_unix
[Replace deprecated Linux-PAM modules]:
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/41357
reply other threads:[~2021-07-01 14:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34f5b89a-3919-e214-a744-4277fba0bbbb@linux.ibm.com \
--to=jrey@linux.ibm.com \
--cc=openbmc@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).