Hi,
how could I generate sha512 password hashes for Linux on OpenBSD?
Using 'crypto' from Python is no go, as this is OS dependent. So I
tried following via passlib but it does not work, ie. I can't login on EL7.
~~~
#!/usr/bin/python2.7
from passlib.hash import sha512_crypt
import getpass
hash = sha512_crypt.using(salt_size=16).encrypt(getpass.getpass())
# XXX
# print(hash)
hl = hash.split("$",3)
print("$6$%s" % hl[3])
~~~
It does add 'rounds=656000$', so removing this is needed.
On EL7 with hash from above:
echo
'userfoo:$6$1AfrAnSyjs7Xpki7$59aX53IQcu9JRZKdHT311HOurgVftM/5RlgOrz7fFlDcQEqhcoUCvuDeXyMogTQrvwtmWE8Tnr2vhV2Jf2aqq0'
\
| chpasswd -e
And try ssh as 'userfoo'.
What can I do wrong? What is your way to generate it on OpenBSD?
j.