Adding users with a script

Jason Edgecombe jason at rampaginggeek.com
Sun Dec 27 16:20:37 EST 2009


Jaap Winius wrote:
> Hi all,
>
> If you have 1,000 user names and passwords to add to an MIT Kerberos V 
> database on a Linux system, you could add them all manually with kadmin, 
> but that would be a terrible waste of time. The proper way would be to 
> automate this process with a script, but I have no idea how.
>   
ssh to your master kdc and runthe following as root:
    kadmin.local -q "addprinc -randkey username"
for each user to create a userwith a random password

With a few lines of scripting, you can automate that.

If you have a keytab for an admin account, then you don't have to ssh to 
the kdc, and you can use normal kadmin instead of kadmin.local.

Jason



More information about the Kerberos mailing list