Skip to content

Commit a2ab6e2

Browse files
Merge pull request #10 from VipinRathor/add-krb5-debug
Add info regarding KRB5_TRACE contributed by Vipin Rathor
2 parents 45bb853 + e43724e commit a2ab6e2

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

sections/secrets.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,46 @@ On the next Hadoop command, you'll see a trace like
157157
Commit Succeeded
158158

159159

160+
## OS-level Kerberos Debugging
161+
162+
Starting MIT Kerberos v1.9, Kerberos libraries introduced a debug option which is a boon to any person breaking his/her head over a nasty Kerberos issue. It is also a good way to understand how does Kerberos library work under the hood. User can set an environment variable called `KRB5_TRACE` to a filename or to `/dev/stdout` and Kerberos programs (like kinit, klist and kvno etc.) as well as Kerberos libraries (libkrb5* ) will start printing more interesting details.
163+
164+
This is a very powerfull feature and can be used to debug any program which uses Kerberos libraries (e.g. CURL). It can also be used in conjunction with other debug options like `HADOOP_JAAS_DEBUG` and `sun.security.krb5.debug`.
165+
166+
```
167+
export KRB5_TRACE=/tmp/kinit.log
168+
```
169+
170+
After setting this up in the terminal, the kinit command will produce something similar to this:
171+
172+
```
173+
# kinit admin/admin
174+
Password for admin/[email protected]:
175+
176+
# cat /tmp/kinit.log
177+
[5709] 1488484765.450285: Getting initial credentials for admin/[email protected]
178+
[5709] 1488484765.450556: Sending request (200 bytes) to MYKDC.COM
179+
[5709] 1488484765.450613: Resolving hostname sandbox.hortonworks.com
180+
[5709] 1488484765.450954: Initiating TCP connection to stream 172.17.0.2:88
181+
[5709] 1488484765.451060: Sending TCP request to stream 172.17.0.2:88
182+
[5709] 1488484765.461681: Received answer from stream 172.17.0.2:88
183+
[5709] 1488484765.461724: Response was not from master KDC
184+
[5709] 1488484765.461752: Processing preauth types: 19
185+
[5709] 1488484765.461764: Selected etype info: etype aes256-cts, salt "(null)", params ""
186+
[5709] 1488484765.461767: Produced preauth for next request: (empty)
187+
[5709] 1488484765.461771: Salt derived from principal: MYKDC.COMadminadmin
188+
[5709] 1488484765.461773: Getting AS key, salt "MYKDC.COMadminadmin", params ""
189+
[5709] 1488484770.985461: AS key obtained from gak_fct: aes256-cts/93FB
190+
[5709] 1488484770.985518: Decrypted AS reply; session key is: aes256-cts/2C56
191+
[5709] 1488484770.985531: FAST negotiation: available
192+
[5709] 1488484770.985555: Initializing FILE:/tmp/krb5cc_0 with default princ admin/[email protected]
193+
[5709] 1488484770.985682: Removing admin/[email protected] -> krbtgt/[email protected] from FILE:/tmp/krb5cc_0
194+
[5709] 1488484770.985688: Storing admin/[email protected] -> krbtgt/[email protected] in FILE:/tmp/krb5cc_0
195+
[5709] 1488484770.985742: Storing config in FILE:/tmp/krb5cc_0 for krbtgt/[email protected]: fast_avail: yes
196+
[5709] 1488484770.985758: Removing admin/[email protected] -> krb5_ccache_conf_data/fast_avail/krbtgt\/MYKDC.COM\@MYKDC.COM@X-CACHECONF: from FILE:/tmp/krb5cc_0
197+
[5709] 1488484770.985763: Storing admin/[email protected] -> krb5_ccache_conf_data/fast_avail/krbtgt\/MYKDC.COM\@MYKDC.COM@X-CACHECONF: in FILE:/tmp/krb5cc_0
198+
```
199+
160200

161201
## KRB5CCNAME
162202

0 commit comments

Comments
 (0)