I am running MIT Kerberos V and I would like to automate the creation of principals. The page here explains how to do this by providing principal names and passwords on the command line like so:
awk '{ print "ank +needchange -pw", $2, $1 }' < /tmp/princnames |
time /usr/sbin/kadmin.local> /dev/null
Where ank
is a synonym for add_principal
(per kadmin(5)
) and it is assumed that /tmp/princnames
is of the form:
principal1 password1
principal2 password2
...
The obvious drawback of this is that each principal's password must be supplied in the clear. Is there any way I can pass a crypto hash instead?
This is for two reasons:
- Security, obviously.
- I'm migrating from an old system and would like my users to be able to authenticate with their old passwords so I would like to pass their hashed passwords from the shadow file to Kerberos.