Merge pull request 'Add CLI script for hashing LDAP passwords' (#239) from chore/ldap_hash_password_script into master

Reviewed-on: #239
This commit is contained in:
Râu Cao 2020-11-20 13:39:40 +00:00
commit 21be68feb5
1 changed files with 5 additions and 0 deletions

5
scripts/ldap/hash_pw.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
password=$(ruby -r base64 -r digest -r securerandom -e "salt = SecureRandom.hex(32); password = '$1'; puts '{SSHA512}' + Base64.strict_encode64(Digest::SHA512.digest(password + salt) + salt)");
echo $password;