19.8.4. 预加密用户密码
您可以使用 ovirt-engine-crypto-tool
脚本创建预加密用户密码。如果您要通过脚本将用户和密码添加到数据库,则此选项很有用。
注意
密码以加密的形式存储在 Manager 数据库中。使用 ovirt-engine-crypto-tool
脚本,因为所有密码都必须使用相同的算法加密。
如果预加密密码,则无法执行密码有效期测试。即使密码不符合密码验证策略,也会接受密码。
运行以下命令:
# /usr/share/ovirt-engine/bin/ovirt-engine-crypto-tool.sh pbe-encode
该脚本将提示您输入密码。
或者,您可以使用
--password=file: file
选项来加密显示为文件的第一行的单个密码。这个选项对自动化非常有用。在以下示例中,文件是
包含单个密码用于加密的文本文件:# /usr/share/ovirt-engine/bin/ovirt-engine-crypto-tool.sh pbe-encode --password=file:file
使用
--encrypted
选项,使用ovirt-aaa-jdbc-tool
脚本设置新密码:# ovirt-aaa-jdbc-tool user password-reset test1 --password-valid-to="2025-08-01 12:00:00-0800" --encrypted
输入并确认加密的密码:
Password: Reenter password: updating user test1... user updated successfully