This cheat sheet contains common commands regarding Kerberos administration and troubleshooting.
$> klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: kafka_producer/[email protected]
Valid starting Expires Service principal
05/23/18 08:56:59 05/24/18 08:56:59 krbtgt/[email protected]
$> kinit kafka/admin
Password for kafka/[email protected]:
$> kinit -k -t /var/lib/secret/kafka.key kafka/admin
$> klist -k -t /var/lib/secret/kafka.key
Keytab name: FILE:/var/lib/secret/kafka.key
KVNO Timestamp Principal
---- ----------------- --------------------------------------------------------
2 05/23/18 08:56:43 zookeeper/[email protected]
2 05/23/18 08:56:43 zookeeper/[email protected]
2 05/23/18 08:56:43 kafka/[email protected]
2 05/23/18 08:56:43 kafka/[email protected]
2 05/23/18 08:56:43 kafka/[email protected]
2 05/23/18 08:56:43 kafka/[email protected]
2 05/23/18 08:56:43 kafka/[email protected]
2 05/23/18 08:56:43 kafka/[email protected]
2 05/23/18 08:56:43 kafka_consumer/[email protected]
2 05/23/18 08:56:43 kafka_consumer/[email protected]
2 05/23/18 08:56:43 kafka_producer/[email protected]
2 05/23/18 08:56:43 kafka_producer/[email protected]
$> kdestroy
$> kadmin.local -w password -q "add_principal -pw my_password kafka/[email protected]"
WARNING: no policy specified for [email protected]; defaulting to no policy
Principal "kafka/[email protected]" created
$> kadmin.local -w password -q "add_principal -randkey kafka/[email protected]"
WARNING: no policy specified for [email protected]; defaulting to no policy
Principal "kafka/[email protected]" created
$> kadmin.local -w password -q "ktadd -k /var/lib/secret/kafka.key -glob kafka/*"
Entry for principal kafka/[email protected] with kvno 3, encryption type aes256-cts-hmac-sha1-96 added to keytab FILE:/etc/krb5.keytab.
Entry for principal kafka/[email protected] with kvno 3, encryption type aes128-cts-hmac-sha1-96 added to keytab FILE:/etc/krb5.keytab.
Entry for principal kafka/[email protected] with kvno 3, encryption type aes256-cts-hmac-sha1-96 added to keytab FILE:/etc/krb5.keytab.
Entry for principal kafka/[email protected] with kvno 3, encryption type aes128-cts-hmac-sha1-96 added to keytab FILE:/etc/krb5.keytab.
Entry for principal kafka/[email protected] with kvno 3, encryption type aes256-cts-hmac-sha1-96 added to keytab FILE:/etc/krb5.keytab.
Entry for principal kafka/[email protected] with kvno 3, encryption type aes128-cts-hmac-sha1-96 added to keytab FILE:/etc/krb5.keytab