| 1. |
How Do I Generate Crypted Passwords For The User Module? |
|
Answer» The mkpasswd utility that is available on most Linux systems is a great OPTION: mkpasswd --method=sha-512 If this utility is not installed on your SYSTEM (e.g. you are using OS X) then you can still easily generate these passwords using PYTHON. First, ensure that the Passlib password hashing library is installed. pip install passlib Once the library is ready, SHA512 password values can then be generated as follows: python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())" Use the integrated Hashing filters to generate a hashed version of a password. You shouldn’t put plaintext passwords in your playbook or host_vars; instead, use Vault to encrypt sensitive data. The mkpasswd utility that is available on most Linux systems is a great option: mkpasswd --method=sha-512 If this utility is not installed on your system (e.g. you are using OS X) then you can still easily generate these passwords using Python. First, ensure that the Passlib password hashing library is installed. pip install passlib Once the library is ready, SHA512 password values can then be generated as follows: python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())" Use the integrated Hashing filters to generate a hashed version of a password. You shouldn’t put plaintext passwords in your playbook or host_vars; instead, use Vault to encrypt sensitive data. |
|