【问题标题】:Centos 7 #openssl passwd - no sha512 optionCentos 7 #openssl passwd - 没有 sha512 选项
【发布时间】: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 年以来就在代码库中。

标签: openssl centos7


【解决方案1】:

CentOS 7 提供了较旧版本的 OpenSSL,特别是已修补的 1.0.2k。但是,此版本不提供您正在寻找的功能。

考虑使用同时可用的来自 EPEL 7 的 openssl11 RPM 软件包,它提供与 RHEL/CentOS 8 相同版本的 OpenSSL。使用openssl11 而不是openssl 重新运行您的命令会导致所需的结果。

【讨论】:

    猜你喜欢
    • 2023-04-04
    • 1970-01-01
    • 2020-06-02
    • 1970-01-01
    • 2018-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多