Kerberos login and related functions. Work in progress.