kinit in a Linux API

Jason Gerfen jason.gerfen at
Mon Aug 29 13:48:42 EDT 2005

A more appropriate sequence, as shown in the kinit.c from the MIT krb5 
libs.  As I am still fairly new to using these undocumented calls, I may 
be wrong in the sequence of using the krb5 libs correctly.  Someone 
correct me if i am wrong.

Set your options from the krb5.conf using the 
krb5_get_init_creds_opt_*() calls first.

1. krb5_init_context()
2. krb5_cc_resolve()
3. krb5_cc_default()
4. krb5_creds()
5. krb5_parse_name()
6. krb5_sname_to_principal()
7. krb5_cc_get_principal() <- if principal doesnt exist
8. krb5_parse_name() <- only if we had to retrieve krb principal
9. krb5_unparse_name()
10. krb5_free_cred_contents() & krb5_kt_close()

I hope I am accurate here, but if you review the kinit.c file you will 
get the information you need.

SFBZH at wrote:

>In the leashw32.lib library from kerberos from Windows, there is a function called Leash_kinit which enable to make a kinit call in a C program.
>If I want to do the same thing under Linux, is there a similar function or should I build a kinit function?
>Best regards
>krbdev mailing list             krbdev at

Jason Gerfen

"The flapping of a butterfly's wings could
 possibly create a typhoon on the other
 side of the world."
~Chaos Theory 

More information about the krbdev mailing list