This script collects and displays all Kerberos tickets in the cache.

Kerberos ticket

# cat get-ticket.sh

#!/bin/sh
kinit -kt /etc/security/keytabs/hive.service.keytab hive/$(hostname -f)@INDEXIMA.CO
klist
echo ""
BASH

Example of get_ticket.sh execution

example

# ./get-ticket.sh
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: hive/ns391011.co@INDEXIMA.COM

Valid starting  Expires     Service principal
16:37:46        16:57:00    krbtgt/INDEXIMA.COM@INDEXIMA.COM
------------------------------------------------------------
BASH