我在安装脚本中有此命令

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标志(用于指定密码)不是用于指定纯文本密码。

这是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

尽管在命令行上指定普通密码可能是一个安全漏洞,因为它可能会记录在命令行历史记录中。

关于linux - 脚本Cent0S 5.4中此命令的问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5654839/

10-14 19:26
查看更多