Using Kerberos from OS X/MacOS and keeping Kerberos ticket valid

When Kerberos has been configured on Mac OS X, you will still have to create the Kerberos ticket manually every time you log in or it has expired by running the command
kinit --keychain username@YOURDOMAIN.LOCAL

The attached script will run in the background and keep your Kerberos ticket valid at all times.

Installation

To install, first download the below script:

Then open a Terminal window and run the following commands:

kinit --keychain username@YOURDOMAIN.LOCAL # <-- replace with your details here. Type your password when prompted. cd ~/Downloads chmod u+x kerberos-refresh-ticket.sh ./kerberos-refresh-ticket.sh install username@YOURDOMAIN.LOCAL # <-- replace with your details here

When the script is installed it will load at login, verify Kerberos ticket every 60 seconds, and refresh this when needed.

Also, do remember to run the command kinit --keychain username@YOURDOMAIN.LOCAL every time you have renewed your domain password.