Skip to content

Instantly share code, notes, and snippets.

@kyl191
Created February 3, 2015 06:40
Show Gist options
  • Save kyl191/442455bfd47fa8603ba2 to your computer and use it in GitHub Desktop.
Save kyl191/442455bfd47fa8603ba2 to your computer and use it in GitHub Desktop.
password hasher for ansible
# Securely generate a hash for ansible
# don't paste the password into code at any point in time
from __future__ import print_function
from passlib.hash import sha256_crypt
from getpass import getpass
pw = getpass()
print(sha256_crypt.encrypt(pw))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment