Ktab command list out the principals in the keytab file more than 1 time

java, kerberos, security

Solution

My experience has been that the java kerberos tools are often incomplete and/or broken. If you use the kerberos tools from either the MIT or Heimdal libraries, you'll see exactly what those 4 versions are.

For example, using the `ktutil list` command from the Heimdal Kerberos libraries you get:

FILE:/etc/krb5.keytab:

Vno  Type                     Principal          Aliases
  6  aes256-cts-hmac-sha1-96 host/test.com@TEST.COM 
  6  arcfour-hmac-md5        host/test.com@TEST.COM 

A keytab contains an entry for each Key version number, encryption type and principal name. All 3 have to be in agreement for the kerberos protocol to work. Kerberos supports multiple encryption types and part of the protocol is negotiating which encryption type to use. This allows newer versions of the software to support older clients that don't have all the latest encryption.

Problem

It might be a silly question but i want to know why its happening... I have a keytab file for kerberos authentication. I want to list out the kvno and principal name which contained in a keytab file using ktab command. Assume my keytab file is kumar.keytab ``` ktab -l -k kumar.keytab ``` When execute the above command, it displays kvno and principal 5 times. ``` Keytab name: kumar.keytab KVNO Principal ---- ---------------------------- 3 Kumar/hostname@KUMAR.COM 3 Kumar/hostname@KUMAR.COM 3 Kumar/hostname@KUMAR.COM 3 Kumar/hostname@KUMAR.COM 3 Kumar/hostname@KUMAR.COM ``` My question is why its displaying the same value for 5 times? Help would be Appreciated. Thanks,

Original source