Generate salted shadow hashes using Python crypt()

The other day I was doing some server setups (using ansible for automation) and I needed to create the same user/password on four different machines. It’s easy with ansible’s user module, but you need to provide a pre-hashed password. The key is to use python’s crypt.crypt(), which you can do interactively from a python shell: […]