gpt4 book ai didi

linux - 用于验证 root pw 的 Shell 脚本

转载 作者:太空宇宙 更新时间:2023-11-04 11:07:10 26 4
gpt4 key购买 nike

我有一个将用户添加到 Linux 系统的脚本。我打算有一个步骤将根 pw 设置为默认值,但是如果脚本中没有明文形式的 pw,我该如何做到这一点?

最佳答案

查看联机帮助页中的 usermod 选项“-p”:

-p, --password PASSWORD

The encrypted password, as returned by crypt(3).

Note: This option is not recommended because the password (or encrypted
password) will be visible by users listing the processes.

The password will be written in the local /etc/passwd or /etc/shadow file.
This might differ from the password database configured in your PAM
configuration. You should make sure the password respects the system's
password policy.

关于linux - 用于验证 root pw 的 Shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24811628/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com