Skip to content

Create password hash: mkpasswd

generate-random-value

Get current hash method

grep ENCRYPT_METHOD /etc/login.defs

Get available methods

mkpasswd -m help
Available methods:
yescrypt        Yescrypt
gost-yescrypt   GOST Yescrypt
scrypt          scrypt
bcrypt          bcrypt
bcrypt-a        bcrypt (obsolete $2a$ version)
sha512crypt     SHA-512
sha256crypt     SHA-256
sunmd5          SunMD5
md5crypt        MD5
bsdicrypt       BSDI extended DES-based crypt(3)
descrypt        standard 56 bit DES-based crypt(3)
nt              NT-Hash

Generate

_PASS="1"
# salt length = 17
_SALT=$(mktemp -u XXXXXXXXXXXXXXXX)
#
mkpasswd -m sha512crypt $_PASS -s $_SALT
$6$VepB4G3e0NBLLj1q$4LqF7LnlCXCig8tLXOAajp1oFnWuOX7IZ8tm6Jr6tirwJXArBRSY5r4srWKvwe0zyJRl8SzhipKsYgYFSGqLM.