...
salt=`openssl rand -base64 16 | head -c 16`
; echo $salt
hash=`echo -n "${salt}q2w2e2r2" | openssl dgst -md_gost12_512 | awk '{print $2}'`
; echo $hash
shadow="\$gost12512hash\$$salt\$$hash" ; echo $shadow
hash=`echo -n "${salt}q2w2e2r2" | openssl dgst -sha512 | awk '{print $2}'` ; echo $hash
shadow="\$6\$$salt\$$hash" ; echo $shadow
sudo sed -i "s/^luser:[^:]*/luser:${shadow//\//\\/}/" /etc/shadow
; sudo grep luser /etc/shadow
salt="/Ew6fLFg4kxS5Ii."
- $1$ is Message Digest 5 (MD5)
- $2a$ is blowfish
- $5$ is 256-bit Secure Hash Algorithm (SHA-256)
- $6$ is 512-bit Secure Hash Algorithm (SHA-512)
- $y$ (or $7$) is yescrypt
echo -n "`openssl rand -base64 16 | head -c 16`Пароль" | openssl dgst -md_gost12_512 | sed "s/^.*= /\$gost12512hash\$/"
...