Skip to content

Instantly share code, notes, and snippets.

@hbeatty
Last active September 13, 2018 01:08
Show Gist options
  • Save hbeatty/25db5847e7068335681db88248d0deaf to your computer and use it in GitHub Desktop.
Save hbeatty/25db5847e7068335681db88248d0deaf to your computer and use it in GitHub Desktop.
How to generate a sha512 hash suitable for /etc/shadow using Mac OSX

How to generate a sha512 hash suitable for /etc/shadow using Mac OSX

$ sudo easy_install pip
$ pip install passlib
$ python -c "from passlib.hash import sha512_crypt; import getpass,string,random; print sha512_crypt.using(salt=''.join([random.choice(string.ascii_letters + string.digits) for _ in range(16)]),rounds=5000).hash(getpass.getpass())"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment