/etc/shadow : how to generate $6$ 's encrypted password?
On Debian-based systems you can use mkpasswd
.
mkpasswd -m sha-512 PASSWORD [SALT]
(PASSWORD
is your desired password; SALT
is optional.)
Strangely, that tool is found in the whois
package.
sudo apt-get install whois
Python:
python -c 'import crypt; print crypt.crypt("password", "$6$saltsalt$")'
(for python 3 and greater it will be print(crypt.crypt(..., ...))
)
Perl:
perl -e 'print crypt("password","\$6\$saltsalt\$") . "\n"'