I have been watching puppet these two days. I am going to use this to manage the assignment and deletion of users in my system. However, every time I use the passwd command of the system to generate a user password, it is a little too troublesome, after searching for a password on the Internet, you can use perl to generate a password stored in shadow for linux users. Perl-e & amp; #39; printcrypt (& quot; 88991026 & quot;, q ($1 $ aCwLBNGo)
I have been watching puppet these two days. I am going to use this to manage the assignment and deletion of users in my system. However, every time I use the passwd command of the system to generate a user password, it is a little too troublesome, after searching for a password on the Internet, you can use perl to generate a password stored in shadow for linux users.
Perl-e 'print crypt ("88991026", q ($1 $ aCwLBNGo), "\ n" '\ where 88991026 is the password to be set for the user, $1 $ aCwLBNGo string is a custom string. generally, $1 $ is followed by 8 characters in shadow.
The style of the generated password string is as follows:
$1 $ aCwLBNGo $0napSn3Qck9Sj4FqP5RFz0
There is a $ in the middle. the preceding value is salt, and the encrypted value is called hash together.
Crypt uses the des algorithm by default.
If salt starts with $1 $, the md5 algorithm is used.
The des algorithm command is as follows:
Perl-e 'print crypt ("88991026", "/g"), "\ n "'
The style of the generated password string is as follows:
/GSr78Mzt1eYI