Generate SHA512 password with CentOS 7,FEDORA 7, RHEL 7

If you need to generate a SHA512 encrypted password for kickstart or perhaps for bootstrapping you servers with automation tools like ansible you can do this easily with python.

python -c 'import crypt,getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))'

If you have python below version 2.7 the you should use this command:

python -c 'import crypt; print crypt.crypt("YOURPasswordGoesHEr3", "$6$saltsalt$")'

 

I am a Senior System Administrator that work daily with Virtualization,Xenserver, Linux, IT automation, Ansible,Windows, Active Directory, Exchange and a lot more. Here you will find tips and trix from early junior, middle junior and senior to unique information of the topics I mentioned earlier. If you need help with something do not hesitate to contact me I will gladly help.

Tagged with: , , , ,