2011-04-13 83 views
0

我在安裝腳本與腳本命令問題Cent0S 5.4

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] 

似乎是運行與最後一個命令的問題有這樣的命令。如果有人有任何想法可能是錯的。

在此先感謝你們。

+1

useradd的'-p'參數用於傳遞編寫的密碼。也許'cdms'不是有效的密碼。 – ThoriumBR 2011-04-13 20:09:01

回答

0

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

雖然命令行上指定的明文口令可能是一個安全漏洞,因爲它可能被記錄在命令行歷史。