Skip to content

Instantly share code, notes, and snippets.

@shawnbutts
Created January 2, 2014 16:35
Show Gist options
  • Save shawnbutts/8221960 to your computer and use it in GitHub Desktop.
Save shawnbutts/8221960 to your computer and use it in GitHub Desktop.
python: generate a password hash for /etc/shadow
import crypt
plaintext_password = 'txetnialp'
salt = crypt.mksalt()
shaadow_password = crypt.crypt(plaintext_password, '$6${0}'.format(salt))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment