23-09-2016 | Remy van Elst | Text only version of this article
These small snippets create password strings you can put in
/etc/shadow when you need to reset a password on a system.
perl -e 'print crypt("password","\$6\$salt\$") . "\n"'
password with the password, and
salt with the salt. Need some random stuff for the salt?
openssl rand -base64 10 iDaorRK/57YZfQ==
On Ubuntu/Debian, install the
whois package. On Arch, install
debian-whois-mkpasswd from the AUR.
mkpasswd -m sha-512 password salt
If you need an older style
crypt password you can use OpenSSL:
openssl passwd -1 -salt salt password