Skip to content
shellhacks.dev

SHA-512 Crypt Password Hash

Generate a $6$ SHA-512 crypt password hash for /etc/shadow, cloud-init, Ansible or usermod, with a random salt and optional rounds.

Free · No sign-up · Your inputs stay in your browser

Input

Generate a SHA-512 crypt password hash ($6$)

Output

Hashing...

The crypt(3) format /etc/shadow, cloud-init's passwd and Ansible's password_hash('sha512') use; the same as openssl passwd -6 -salt saltstring. Debian 11+ and Ubuntu 22.04+ default to yescrypt ($y$) for new passwords but still accept $6$. For a login password prefer an SSH key; for a hash in user data, use a random salt, never the example.

Runs in this browser. Nothing you paste is sent to a server.

Where $6$ hashes are used

/etc/shadow on Linux, the passwd field of cloud-init users, Ansible's user module with password_hash('sha512'), Kickstart and preseed files. The result matches openssl passwd -6 -salt saltstring and mkpasswd -m sha-512. The algorithm is specified in Ulrich Drepper's Unix crypt using SHA-256 and SHA-512.

Newer systems use yescrypt

Debian 11 and later and Ubuntu 22.04 and later hash new passwords with yescrypt ($y$), which is memory-hard. They still verify $6$ hashes, so a $6$ hash in user data works. For server logins, SSH keys are better than any password.

Share

Frequently asked questions

How do I set a user's password from a hash?
sudo usermod -p 'HASH' username, with the hash in single quotes so the shell does not expand the dollar signs.
What does rounds= mean in a crypt hash?
The number of SHA-512 iterations, 5000 by default. A higher value makes each guess more expensive; the value is stored in the hash.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Go deeper

Suggested reading

Keep planning

Similar tools