Archive

Archive for December, 2015

Linux: How to generate a hash password on the command line

December 2, 2015 Leave a comment

Perl

$ perl -e 'print crypt("password","\$6\$saltsalt\$") . "\n"'
$6$saltsalt$qFmFH.bQmmtXzyBY0s9v7Oicd2z4XSIecDzlB5KiA2/jctKu9YterLp8wwnSq.qc.eoxqOmSuNp2xS0ktL3nh/

In these examples the password is the string “password” and the salt is “saltsalt”. Both examples are using $6$ which denotes that you want crypt to use SHA-512.

Categories: Linux, Redhat, Uncategorized