Last active
April 7, 2019 22:24
-
-
Save stefanschmidt/6e2e24397aa8ce42424be832a00cab2b to your computer and use it in GitHub Desktop.
Generate salted SHA-512 hashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using mkpasswd and slappasswd we will generate salted SHA-512 hashes | |
# password: secret | |
# method 1: using mkpasswd | |
# requires whois package on Ubuntu | |
mkpasswd --method=sha-512 --salt=foobar42 | |
$6$foobar42$weYmU8biHjFLegPCuvGBSDaG0QMNucFv4Wq6.TGVK53/U0dp6bTrLYCLAdjecyX5mS1IA8vezYNjzTduU988B0 | |
# method 2: using slappasswd | |
# requires slapd package on Ubuntu | |
# method 2a: with static salt | |
slappasswd -h {CRYPT} -s secret -c '$6$foobar42' | |
{CRYPT}$6$foobar42$weYmU8biHjFLegPCuvGBSDaG0QMNucFv4Wq6.TGVK53/U0dp6bTrLYCLAdjecyX5mS1IA8vezYNjzTduU988B0 | |
# method 2b: with dynamic salt | |
# %.8s is replaced by 8 random characters | |
# see man page of slappasswd for details | |
slappasswd -h {CRYPT} -s secret -c '$6$%.8s' | |
{CRYPT}$6$X7g6B3FD$SH8Ii/AtZg8yrNvu3CwWwf0iXnUzCuaTSelzzL3DeJoY7JMkMD3yohDivtOSaWJQQOv6MHI0jRZ8c7rZGc5hq1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment