【发布时间】:2019-12-07 17:33:27
【问题描述】:
我的 Centos7 机器对 /etc/shadow 文件中的密码使用哈希算法 sha512。 但是在命令行中执行以下命令时没有显示输出:
# openssl passwd -6 -salt xxx yyy -- where xxx is the salt and yyy is the clear text password
要验证可用于 openssl passwd 的选项,我输入:
# openssl passwd -6 -stdin
Usage: passwd [options] [passwords]
where options are
-crypt standard Unix password algorithm (default)
-1 MD5-based password algorithm
-apr1 MD5-based password algorithm, Apache variant
-salt string use provided salt
... output omitted ...
这是没有 sha512 作为此命令选项的标准行为吗? 是否有另一个命令可以即时生成 sha512(salt+password)?
【问题讨论】:
-
你应该检查你的 openssl 版本。 SHA256 和 SHA512 选项自 4e57a12 以来可用,自 2016 年以来就在代码库中。