Skip to content

Instantly share code, notes, and snippets.

@g-koziol
Forked from incepttechnologies/verifyKeytab
Created October 21, 2021 09:41
Show Gist options
  • Save g-koziol/ddc783e58bf9e80b297885ac0b212b88 to your computer and use it in GitHub Desktop.
Save g-koziol/ddc783e58bf9e80b297885ac0b212b88 to your computer and use it in GitHub Desktop.
Verify keytab files
The contents of keytab file can be verified using either Unix/linux ktutil or klist commands or java ktab utility.
(1)
-bash-3.2$ ktutil
ktutil: rkt krba01.keytab
ktutil: list
slot KVNO Principal
---- ---- ------------------------------------------------------------------------------------------------
1 3 HTTP/[email protected]
2 3 [email protected]
(2)
-bash-3.2$ klist -k –t krba01.keytab
KVNO Timestamp Principal
---- ---------------- -----------------------------------------------------------
3 05/12/2013 15:25 HTTP/[email protected]
3 05/12/2013 15:25 [email protected]
(3)
To get encryption type of keys
-bash-3.2$ klist -k -e –t krba01.keytab
Keytab name: FILE:krba01.keytab
KVNO Principal
---- ---------------------------------------------------------------------------------
3 HTTP/[email protected] (ArcFour with HMAC/md5)
3 [email protected] (ArcFour with HMAC/md5)
(4)
Alternatively you can also use Klist or Ktab utility that comes with standard java.
C:\>java sun.security.krb5.internal.tools.Klist -k -t krba01.keytab
Key tab: krba01.keytab, 2 entries found.
[1] Service principal: HTTP/[email protected]
KVNO: 3
Time stamp: Dec 05, 2013 15:25
[2] Service principal: [email protected]
KVNO: 3
Time stamp: Dec 05, 2013 15:25
C:\>java sun.security.krb5.internal.tools.Ktab -l -e -t -k krba01.keytab
Keytab name: krba01.keytab
KVNO Timestamp Principal
---- --------------- ---------------------------------------------------------------------------
3 12/5/13 3:25 PM HTTP/[email protected] (23:RC4 with HMAC)
3 12/5/13 3:25 PM [email protected] (23:RC4 with HMAC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment