Centos system user password string generation command-shadow

Source: Internet
Author: User
Tags crypt
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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.