【问题标题】:Problems with this command in script Cent0S 5.4脚本 Cent0S 5.4 中此命令的问题
【发布时间】:2011-04-13 19:54:53
【问题描述】:

我在安装脚本中有这个命令

Running Command: useradd ftpsecure
Running Command: /etc/init.d/vsftpd restart
Running Command: chkconfig --add vsftpd
Running Command: chkconfig vsftpd on
Running Command: /usr/sbin/groupadd cdms-users
Running Command: /usr/sbin/useradd -g cdms-users -d /ftpUploads/ cdmsUser -p cdms
        [ESC[0;31mFAILEDESC[0m]

最后一个命令似乎遇到了问题。如果有人知道什么可能是错的。

提前谢谢各位。

【问题讨论】:

  • useradd-p参数用于传递加密后的密码。也许cdms 不是有效密码。

标签: linux unix


【解决方案1】:

useradd-p 标志(用于指定密码)不用于指定明文密码。

这是来自useradd 的手册页的描述。

   -p, --password PASSWORD
       The encrypted password, as returned by crypt(3). The default is to disable the
       password.

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

       You should make sure the password respects the system's password policy.

您必须为密码生成 crypt 哈希。

另一个 StackOverflow 线程中接受的答案显示了一种方法:Useradd using crypt password generation

虽然在命令行上指定纯密码可能是一个安全漏洞,因为它可以记录在命令行历史记录中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-24
    • 1970-01-01
    • 1970-01-01
    • 2020-03-21
    • 1970-01-01
    • 2019-12-25
    相关资源
    最近更新 更多