我有一个 kickstart 来为 root 设置密码。
目前,预置文件中的内容如下:
rootpw --iscrypted $1$lK/0.tLv$XdsDIJ3KNU/Ta9r1Pr6Qt1
如何为 root 密码生成新的哈希值?
在此深表感谢。
答案1
根据当前哈希值(查看$1
),似乎是 MD5 哈希值。如果是这种情况,请尝试以下操作:
openssl passwd -1
规范参考是手册页:https://man7.org/linux/man-pages/man3/crypt.3.html
id identifies the encryption method used instead of DES and this
then determines how the rest of the password string is
interpreted. The following values of id are supported:
ID | Method
1 | MD5
2a | Blowfish (not in mainline glibc; added in some Linux distributions)
5 | SHA-256 (since glibc 2.7)
6 | SHA-512 (since glibc 2.7)