Check Exit Status Code for Kerberos Ticket Validity

If you’re familiar with Kerberos, one way to check if a ticket is valid is to run klist command. ❯ klist Ticket cache: FILE:/tmp/krb5cc_1001 Default principal: username@UNIVERSITY.EDU.AU Valid starting Expires Service principal 02/07/21 11:26:50 02/07/21 21:26:50 krbtgt/UNIVERSITY.EDU.AU@UNIVERSITY.EDU.AU renew until 03/07/21 11:26:50 02/07/21 12:24:07 02/07/21 21:26:50 cifs/server1.UNIVERSITY.edu.au@UNIVERSITY.EDU.AU 02/07/21 12:24:07 02/07/21 21:26:50 cifs/server1.UNIVERSITY.edu.au@UNIVERSITY.EDU.AU ❯ date Mon 05 Jul 2021 16:01:59 AEST From the above output, the principal ticket expired since 2 Jul. So how do we find out if the Kerberos (principal) ticket expires programmatically?...

July 5, 2021 · 2 min · 284 words · kenno