/**********************************************************************
* useradd密码无效
* 说明:
* 在测试Ubuntu系统的时候采用useradd自动添加用户、密码的时候,出现
* 密码无效的问题。
*
* 2018-4-24 深圳 宝安西乡 曾剑锋
*********************************************************************/
一、参考文档:
1. How do I encrypt a new user's password using the useradd command?
https://askubuntu.com/questions/752500/how-do-i-encrypt-a-new-users-password-using-the-useradd-command
2. Generating Passwords Using crypt(3)
https://administratosphere.wordpress.com/2011/06/16/generating-passwords-using-crypt3/
3. Linux useradd command
https://www.computerhope.com/unix/useradd.htm
二、解决办法:
1. -p, --password PASSWORD The encrypted password, as returned by crypt. The default is to disable the password.
2. 通过useradd命令行直接添加的password,需要提前进行加密;