Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save brian-tex/8ce798545eaaf6fdb55fec77fbe1eed7 to your computer and use it in GitHub Desktop.

Select an option

Save brian-tex/8ce798545eaaf6fdb55fec77fbe1eed7 to your computer and use it in GitHub Desktop.

Introduction:

  • This Page shows how to make a SHA-512 hash. This is needed for creating a hash of a SysAdmin user account password as it allows other SysAdmins to set each other's passwords without knowing what the password is.

Workflow Prerequisites

  • A Linux or Mac computer.
    • Linux: The mkpasswod binary (found in the whois package).
    • Mac: Python3 and passlib

Create the Password Hash

Ubuntu

  1. Open Terminal.
  2. Make sure mkpasswd is installed: sudo apt install -y whois
  3. Run mkpasswd -m sha-512.
  4. Type in whatever it is you want to hash and press return or Enter.
  5. Terminal will print out the SHA-512 hash.

Mac

  1. Open Terminal.
  2. Make sure passlib is installed: pip3 install passlib
  3. Generage the password hash: python3 -c "from passlib.hash import sha512_crypt; import getpass; print(sha512_crypt.using(rounds=5000).hash(getpass.getpass()))"
  4. Type in whatever it is you want to hash and press return or Enter.
  5. Terminal will print out the SHA-512 hash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment