<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://dreness.com/wikimedia/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dre</id>
		<title>Wikifications - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://dreness.com/wikimedia/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dre"/>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Special:Contributions/Dre"/>
		<updated>2026-05-23T13:42:25Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Main_Page&amp;diff=1308</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Main_Page&amp;diff=1308"/>
				<updated>2017-02-18T23:18:02Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Update site link for SSL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Hey, another wiki. Great! ===&lt;br /&gt;
Here, you will find things. You may notice that anonymous edits are firmly &amp;#039;&amp;#039;&amp;#039;DISABLED&amp;#039;&amp;#039;&amp;#039;. Yeah, THAT&amp;#039;S RIGHT. I am intentionally destroying the communal benefits that wiki was designed to provide. Why? I friggin hate spam, and my two previous wikis were consumed by friggin spambots. You may also notice that you can&amp;#039;t create a user account. COPE! :) If you really want to contribute, please mail me at dreNOSPAMPLSKTHX@mac.com, and I&amp;#039;d be more than happy to let you in.&lt;br /&gt;
&lt;br /&gt;
UPDATE: Even this one got spam-bombed. Note to self: use of &amp;#039;one-click upgrades&amp;#039; are unlikely to migrate configuration file directives when the syntax changes.&lt;br /&gt;
&lt;br /&gt;
Here is the page of [[User:Dre]], your esteemed information broker.&lt;br /&gt;
&lt;br /&gt;
You may want to scope my other, less sandbox-like presence: https://dreness.com&lt;br /&gt;
&lt;br /&gt;
=== Mac OS X ===&lt;br /&gt;
[[Parallels]] - Wrangling virtual machines!&lt;br /&gt;
&lt;br /&gt;
[[Cool Apps]] - A list of applications that I&amp;#039;ve found useful / cool&lt;br /&gt;
&lt;br /&gt;
[[TigerPage]] - This stuff is all specific to Mac OS X 10.4, Tiger. Some items discussed here:&lt;br /&gt;
*launchd&lt;br /&gt;
*dummynet&lt;br /&gt;
&lt;br /&gt;
[[LKDC]]&lt;br /&gt;
&lt;br /&gt;
=== IT Stuff ===&lt;br /&gt;
I once maintained a FreeBSD box in colo. Check out the page of [[meta]], where I have notes and instructions for the various services I was running.&lt;br /&gt;
&lt;br /&gt;
Rebuilding [[floe]] from OpenBSD to FreeBSD.&lt;br /&gt;
&lt;br /&gt;
[[Mac OS X Server]] stuff.&lt;br /&gt;
&lt;br /&gt;
[[Net SNMP]] items.&lt;br /&gt;
&lt;br /&gt;
=== Scripting / Development ===&lt;br /&gt;
[[Scripting]] - Here&amp;#039;s where I keep a bunch of scripting snippets / examples. This includes:&lt;br /&gt;
*Basic shell scripting idioms (tests, loops, redirection)&lt;br /&gt;
*zsh profile elements&lt;br /&gt;
*AppleScript Droplet example&lt;br /&gt;
*Perl scripts&lt;br /&gt;
&lt;br /&gt;
[[Useful Commands]] - Some useful and often Mac OS X specific commands. So far:&lt;br /&gt;
*Using dd to rescue data from a dying disk&lt;br /&gt;
*Encypted and growable disk images&lt;br /&gt;
*perl one-liner for global find / replace&lt;br /&gt;
*finding the input device idle time from ioreg&lt;br /&gt;
&lt;br /&gt;
[[cocoa]]&lt;br /&gt;
&lt;br /&gt;
[[php]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[bugzilla]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[phpbb]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[rrdtool]] builds without error in 10.3.9&lt;br /&gt;
&lt;br /&gt;
(old) [[Panther DNS Issues]]&lt;br /&gt;
&lt;br /&gt;
[[Installing and using unix software in userland]]&lt;br /&gt;
&lt;br /&gt;
[[How to make and apply patches]]&lt;br /&gt;
&lt;br /&gt;
[[How to compile other software using Macports libraries]]&lt;br /&gt;
&lt;br /&gt;
=== Quick Reference Pages ===&lt;br /&gt;
[[irssi]] [[screen]] [[X11]] [[q3]] [[color escape sequences]] [[mysql]] [[wow]] [http://sial.org/howto/perl/life-with-cpan CPAN notes] [http://meta.wikimedia.org/wiki/Preventing_Access wikimedia security notes] [[vi]] [[apache]] [[iphone]] [[gnuplot]]&lt;br /&gt;
&lt;br /&gt;
=== [[Network Stuff]] ===&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#Streaming_your_iTunes_music_remotely iTunes Remote Streaming] details the process for using iTunes music sharing across a WAN.&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#AS_.2F_Routing_Reserach AS / Routing Research] includes information about determining the number of discrete logical paths in and out of an Autonomous System (AS)&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#TCP_Timeouts_TCP_Timeouts TCP Timeouts] shows some sysctl configuration for adjusting TCP window sizes.&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#Xinetd.2C_ssh_and_netcat_xinetd.2C_ssh_and_netcat xinetd, ssh and netcat] is a xinetd configuration example showing how to use xinetd to trigger ssh / netcat on demand to encrypt pop3 traffic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
... and then of course, the requisite links to the mediawiki docs, hosted at wikipedia:&lt;br /&gt;
&lt;br /&gt;
Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface]&lt;br /&gt;
and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User&amp;#039;s Guide] for usage and configuration help.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=User_talk:Dre&amp;diff=1307</id>
		<title>User talk:Dre</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=User_talk:Dre&amp;diff=1307"/>
				<updated>2017-02-18T22:55:21Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Created page with &amp;quot;Nobody ever talks here...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nobody ever talks here...&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1306</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1306"/>
				<updated>2010-01-24T06:11:10Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Macros=&lt;br /&gt;
(many of these are outdated)&lt;br /&gt;
&lt;br /&gt;
==Druid==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;innervate&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 #showtooltip&lt;br /&gt;
 /cast Innervate&lt;br /&gt;
 /script s, d, e = GetSpellCooldown(&amp;quot;Innervate&amp;quot;);&lt;br /&gt;
 /script if (s==0) then if (d==0) then SendChatMessage(&amp;quot;Innervate on %t!&amp;quot;, nil); end; else print(&amp;#039;cooldown?&amp;#039;); end&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /use 13 &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
=Videography=&lt;br /&gt;
&lt;br /&gt;
==Camera Control==&lt;br /&gt;
&lt;br /&gt;
Nice camera moves are best achieved by the game itself, as it&amp;#039;s basically impossible to match the smooth motion curves with any sort of human input device. One way to do this is to use the camera presets. By default, the speed at which the camera moves between presets is pretty quick - good for in-game use, but not good for cinematic purposes. You can adjust the camera movement speed by altering the time duration of the transition, using a couple of cvars. They are:&lt;br /&gt;
&lt;br /&gt;
 cameraSmoothTimeMax&lt;br /&gt;
 cameraSmoothTimeMin&lt;br /&gt;
&lt;br /&gt;
* in a slash command context:&lt;br /&gt;
 /console SET cameraSmoothTimeMax 15.0&lt;br /&gt;
 /console SET cameraSmoothTimeMin 15.0&lt;br /&gt;
&lt;br /&gt;
* in a script context:&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,&amp;quot;15&amp;quot;)&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,&amp;quot;15&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
* or you can set both at once using a function for ease-of-use. You&amp;#039;d need to slap this in a macro (or some existing mod) then execute it once to declare the function before you can use it. This function will let you more easily adjust the camera speed (less typing).&lt;br /&gt;
 /script function cam(s) SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,s) SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,s) end&lt;br /&gt;
&lt;br /&gt;
After running the above to declare the function, use the function as shown below. 10 is the duration of the camera preset transition in seconds, but it can be whatever you want. Awesome for videos :)&lt;br /&gt;
 /script cam(10)&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Screen&amp;diff=1305</id>
		<title>Screen</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Screen&amp;diff=1305"/>
				<updated>2009-10-01T16:27:47Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: added screen naming stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Basics ===&lt;br /&gt;
&lt;br /&gt;
Control-a (C-a) is screen attention sequence and preceeds all screen commands. For example, to create a new screen window, type control-a, then c. To clarify even further: hold control, type a, release control, press c.&lt;br /&gt;
&lt;br /&gt;
 c         = new window&lt;br /&gt;
 k         = kill current window&lt;br /&gt;
 d         = detach from screen&lt;br /&gt;
 ?         = show online help&lt;br /&gt;
&lt;br /&gt;
From outside of the screen session:&lt;br /&gt;
 screen -R = reattach&lt;br /&gt;
 screen -x = multi-attach&lt;br /&gt;
&lt;br /&gt;
To set screen name at start time:&lt;br /&gt;
 screen -S foo&lt;br /&gt;
&lt;br /&gt;
To reattach to screen with given name:&lt;br /&gt;
 screen -x foo&lt;br /&gt;
&lt;br /&gt;
=== caption and hardstatus ===&lt;br /&gt;
I use the following with Terminal&amp;#039;s color scheme set to green on black:&lt;br /&gt;
 caption always &amp;quot;%{Mk}%?%-Lw%?%{km}[%n*%f %t]%?(%u)%?%{mk}%?%+Lw%? %{mk}&amp;quot;&lt;br /&gt;
 hardstatus alwayslastline &amp;quot;%{kW}%H %{kB}|%{km} %l %=%{km}%c:%s %D %M/%d/%Y &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Navigation ===&lt;br /&gt;
 &amp;quot;         = list window names, numbers, and flags&lt;br /&gt;
 N         = show current window number&lt;br /&gt;
 A         = set window name&lt;br /&gt;
 &amp;#039;         = specify name or number to switch to&lt;br /&gt;
 space     = next window&lt;br /&gt;
 backspace = prev window&lt;br /&gt;
 #         = goto window number #&lt;br /&gt;
 w         = show window list in status bar&lt;br /&gt;
 C-a       = switch to most recent window&lt;br /&gt;
&lt;br /&gt;
=== Split Windows ===&lt;br /&gt;
 S         = create split in current region&lt;br /&gt;
 tab       = move to next region&lt;br /&gt;
 X         = delete current region&lt;br /&gt;
 Q         = delete all but current region&lt;br /&gt;
&lt;br /&gt;
=== Monitoring ===&lt;br /&gt;
 M         = toggle activity monitor notifications in status bar&lt;br /&gt;
 _         = toggle INactivity monitor notification in status bar (e.g. for when something&amp;#039;s done compiling)&lt;br /&gt;
 m         = recall last message displayed in status bar&lt;br /&gt;
 C-g       = toggle audio / visual bell&lt;br /&gt;
 t         = show time / load average&lt;br /&gt;
&lt;br /&gt;
=== Scrollback / copy mode movement keys ===&lt;br /&gt;
&lt;br /&gt;
 [       = enter copy mode&lt;br /&gt;
         h, j, k, l move the cursor line by line or column by column.&lt;br /&gt;
         0,  ^  and  $  move to the leftmost column, to the first or last non-&lt;br /&gt;
           whitespace character on the line.&lt;br /&gt;
         H, M and L move the cursor to the leftmost column of the top,  center&lt;br /&gt;
           or bottom line of the window.&lt;br /&gt;
         + and - positions one line up and down.&lt;br /&gt;
         G moves to the specified absolute line (default: end of buffer).&lt;br /&gt;
         | moves to the specified absolute column.&lt;br /&gt;
         w, b, e move the cursor word by word.&lt;br /&gt;
         B, E move the cursor WORD by WORD (as in vi).&lt;br /&gt;
         C-u  and  C-d  scroll  the display up/down by the specified amount of&lt;br /&gt;
           lines while preserving the cursor position. (Default: half  screen-&lt;br /&gt;
           full).&lt;br /&gt;
         C-b and C-f scroll the display up/down a full screen.&lt;br /&gt;
         g moves to the beginning of the buffer.&lt;br /&gt;
         % jumps to the specified percentage of the buffer.&lt;br /&gt;
&lt;br /&gt;
===Pasteboard===&lt;br /&gt;
Paste the contents of the pasteboard&lt;br /&gt;
 C-a ]&lt;br /&gt;
&lt;br /&gt;
Read the /etc/passwd file into register p and paste it back out&lt;br /&gt;
 C-a : readreg p /etc/passwd&lt;br /&gt;
 C-a : paste p&lt;br /&gt;
&lt;br /&gt;
 Marking:&lt;br /&gt;
   The  copy range is specified by setting two marks. The text between&lt;br /&gt;
   these marks will be highlighted. Press&lt;br /&gt;
   space to set the first or second mark respectively.&lt;br /&gt;
   Y and y used to mark one whole line or to mark from start of line.&lt;br /&gt;
   W marks exactly one word.&lt;br /&gt;
 Repeat count:&lt;br /&gt;
   Any of these commands can be prefixed with a repeat count number by&lt;br /&gt;
   pressing digits 0..9 which is taken as a repeat count.&lt;br /&gt;
   Example:  &amp;quot;C-a  C-[  H  10 j 5 Y&amp;quot; will copy lines 11 to 15 into the&lt;br /&gt;
   paste buffer.&lt;br /&gt;
 Searching:&lt;br /&gt;
   / Vi-like search forward.&lt;br /&gt;
   ? Vi-like search backward.&lt;br /&gt;
   C-a s Emacs style incremental search forward.&lt;br /&gt;
   C-r Emacs style reverse i-search.&lt;br /&gt;
 Specials:&lt;br /&gt;
   There are however some keys that act differently than  in  vi.   Vi&lt;br /&gt;
   does  not  allow one to yank rectangular blocks of text, but screen&lt;br /&gt;
   does. Press c or C to set the left or right margin  respectively.  If  no  repeat&lt;br /&gt;
   count is given, both default to the current cursor position.&lt;br /&gt;
   Example: Try this on a rather full text screen: &amp;quot;C-a [ M 20 l SPACE&lt;br /&gt;
   c 10 l 5 j C SPACE&amp;quot;.&lt;br /&gt;
   This moves one to the middle line of the screen, moves in  20  col-&lt;br /&gt;
   umns  left,  marks the beginning of the paste buffer, sets the left&lt;br /&gt;
   column, moves 5 columns down, sets the right column, and then marks&lt;br /&gt;
   the end of the paste buffer. Now try:&lt;br /&gt;
   &amp;quot;C-a [ M 20 l SPACE 10 l 5 j SPACE&amp;quot;&lt;br /&gt;
   and notice the difference in the amount of text copied.&lt;br /&gt;
  J  joins lines. It toggles between 4 modes: lines separated by a new-&lt;br /&gt;
    line character (012), lines glued seamless, lines  separated  by  a&lt;br /&gt;
   single  whitespace  and  comma  separated  lines. Note that you can&lt;br /&gt;
   prepend the newline character with a carriage return character,  by&lt;br /&gt;
   issuing a &amp;quot;crlf on&amp;quot;.&lt;br /&gt;
  v  is  for all the vi users with &amp;quot;:set numbers&amp;quot; - it toggles the left&lt;br /&gt;
   margin between column 9 and 1. Press&lt;br /&gt;
   a before the final space key to toggle in append mode. Thus the  con-&lt;br /&gt;
   tents  of the paste buffer will not be overwritten, but is appended&lt;br /&gt;
   to.&lt;br /&gt;
  A toggles in append mode and sets a (second) mark.&lt;br /&gt;
   &amp;gt; sets the (second) mark and writes the contents of the paste  buffer&lt;br /&gt;
   to the screen-exchange file (/tmp/screen-exchange per default) once&lt;br /&gt;
   copy-mode is finished.&lt;br /&gt;
   This example demonstrates how to dump the whole  scrollback  buffer&lt;br /&gt;
   to that file: &amp;quot;C-A [ g SPACE G $ &amp;gt;&amp;quot;.&lt;br /&gt;
   C-g gives information about the current line and column.&lt;br /&gt;
  x  exchanges  the first mark and the current cursor position. You can&lt;br /&gt;
   use this to adjust an already placed mark.&lt;br /&gt;
  @ does nothing. Does not even exit copy mode.&lt;br /&gt;
   All keys not described here exit copy mode.&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
Commands can exist in .screenrc or can be entered interactively with C-a, :&lt;br /&gt;
&lt;br /&gt;
send the &amp;#039;whoami&amp;#039; command to all screen windows simultaneously (\015 is octal for carriage return)&lt;br /&gt;
 at \# stuff &amp;quot;whoami\015&amp;quot;&lt;br /&gt;
&lt;br /&gt;
back to [[Main Page]]&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Gnuplot&amp;diff=1304</id>
		<title>Gnuplot</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Gnuplot&amp;diff=1304"/>
				<updated>2009-09-08T18:21:14Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Basic x / y plot of data from a file in the form:&lt;br /&gt;
&lt;br /&gt;
 x1 y1&lt;br /&gt;
 x2 y2&lt;br /&gt;
 x3 y3&lt;br /&gt;
&lt;br /&gt;
 set ytic auto&lt;br /&gt;
 set xtic auto&lt;br /&gt;
 set title &amp;quot;iCal Server Queue Depth / Latency&amp;quot;&lt;br /&gt;
 set xlabel &amp;quot;Queue Depth&amp;quot;&lt;br /&gt;
 set ylabel &amp;quot;Latency&amp;quot;&lt;br /&gt;
 plot &amp;quot;ical-queues.txt&amp;quot; using 1:1 title &amp;quot;Queue Depth&amp;quot; with lines&lt;br /&gt;
 plot &amp;quot;ical-queues.txt&amp;quot; using 1:2 title &amp;quot;Latency&amp;quot; with lines&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Gnuplot&amp;diff=1303</id>
		<title>Gnuplot</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Gnuplot&amp;diff=1303"/>
				<updated>2009-09-08T18:20:53Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: New page: Basic x / y plot of data from a file in the form:   x1 y1  x2 y2  x3 y3   set ytic auto  set xtic auto  set title &amp;quot;iCal Server Queue Depth / Latency&amp;quot;  set xlabel &amp;quot;Queue Depth&amp;quot;  set ylabel ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Basic x / y plot of data from a file in the form:&lt;br /&gt;
&lt;br /&gt;
 x1 y1&lt;br /&gt;
 x2 y2&lt;br /&gt;
 x3 y3&lt;br /&gt;
&lt;br /&gt;
 set ytic auto&lt;br /&gt;
 set xtic auto&lt;br /&gt;
 set title &amp;quot;iCal Server Queue Depth / Latency&amp;quot;&lt;br /&gt;
 set xlabel &amp;quot;Queue Depth&amp;quot;&lt;br /&gt;
 set ylabel &amp;quot;Latency&amp;quot;&lt;br /&gt;
 plot &amp;quot;ical-queues.tx t&amp;quot; using 1:1 title &amp;quot;Queue Depth&amp;quot; with lines&lt;br /&gt;
 plot &amp;quot;ical-queues.txt&amp;quot; using 1:2 title &amp;quot;Latency&amp;quot; with lines&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Main_Page&amp;diff=1302</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Main_Page&amp;diff=1302"/>
				<updated>2009-09-08T18:19:51Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Quick Reference Pages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Hey, another wiki. Great! ===&lt;br /&gt;
Here, you will find things. You may notice that anonymous edits are firmly &amp;#039;&amp;#039;&amp;#039;DISABLED&amp;#039;&amp;#039;&amp;#039;. Yeah, THAT&amp;#039;S RIGHT. I am intentionally destroying the communal benefits that wiki was designed to provide. Why? I friggin hate spam, and my two previous wikis were consumed by friggin spambots. You may also notice that you can&amp;#039;t create a user account. COPE! :) If you really want to contribute, please mail me at dreNOSPAMPLSKTHX@mac.com, and I&amp;#039;d be more than happy to let you in.&lt;br /&gt;
&lt;br /&gt;
UPDATE: Even this one got spam-bombed. Note to self: use of &amp;#039;one-click upgrades&amp;#039; are unlikely to migrate configuration file directives when the syntax changes.&lt;br /&gt;
&lt;br /&gt;
Here is the page of [[User:Dre]], your esteemed information broker.&lt;br /&gt;
&lt;br /&gt;
You may want to scope my other, less sandbox-like presence: http://www.dreness.com, or my tech blog: http://www.dreness.com/blog&lt;br /&gt;
&lt;br /&gt;
=== Mac OS X ===&lt;br /&gt;
[[Parallels]] - Wrangling virtual machines!&lt;br /&gt;
&lt;br /&gt;
[[Cool Apps]] - A list of applications that I&amp;#039;ve found useful / cool&lt;br /&gt;
&lt;br /&gt;
[[TigerPage]] - This stuff is all specific to Mac OS X 10.4, Tiger. Some items discussed here:&lt;br /&gt;
*launchd&lt;br /&gt;
*dummynet&lt;br /&gt;
&lt;br /&gt;
[[LKDC]]&lt;br /&gt;
&lt;br /&gt;
=== IT Stuff ===&lt;br /&gt;
I once maintained a FreeBSD box in colo. Check out the page of [[meta]], where I have notes and instructions for the various services I was running.&lt;br /&gt;
&lt;br /&gt;
Rebuilding [[floe]] from OpenBSD to FreeBSD.&lt;br /&gt;
&lt;br /&gt;
[[Mac OS X Server]] stuff.&lt;br /&gt;
&lt;br /&gt;
[[Net SNMP]] items.&lt;br /&gt;
&lt;br /&gt;
=== Scripting / Development ===&lt;br /&gt;
[[Scripting]] - Here&amp;#039;s where I keep a bunch of scripting snippets / examples. This includes:&lt;br /&gt;
*Basic shell scripting idioms (tests, loops, redirection)&lt;br /&gt;
*zsh profile elements&lt;br /&gt;
*AppleScript Droplet example&lt;br /&gt;
*Perl scripts&lt;br /&gt;
&lt;br /&gt;
[[Useful Commands]] - Some useful and often Mac OS X specific commands. So far:&lt;br /&gt;
*Using dd to rescue data from a dying disk&lt;br /&gt;
*Encypted and growable disk images&lt;br /&gt;
*perl one-liner for global find / replace&lt;br /&gt;
*finding the input device idle time from ioreg&lt;br /&gt;
&lt;br /&gt;
[[cocoa]]&lt;br /&gt;
&lt;br /&gt;
[[php]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[bugzilla]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[phpbb]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[rrdtool]] builds without error in 10.3.9&lt;br /&gt;
&lt;br /&gt;
(old) [[Panther DNS Issues]]&lt;br /&gt;
&lt;br /&gt;
[[Installing and using unix software in userland]]&lt;br /&gt;
&lt;br /&gt;
[[How to make and apply patches]]&lt;br /&gt;
&lt;br /&gt;
[[How to compile other software using Macports libraries]]&lt;br /&gt;
&lt;br /&gt;
=== Quick Reference Pages ===&lt;br /&gt;
[[irssi]] [[screen]] [[X11]] [[q3]] [[color escape sequences]] [[mysql]] [[wow]] [http://sial.org/howto/perl/life-with-cpan CPAN notes] [http://meta.wikimedia.org/wiki/Preventing_Access wikimedia security notes] [[vi]] [[apache]] [[iphone]] [[gnuplot]]&lt;br /&gt;
&lt;br /&gt;
=== [[Network Stuff]] ===&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#Streaming_your_iTunes_music_remotely iTunes Remote Streaming] details the process for using iTunes music sharing across a WAN.&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#AS_.2F_Routing_Reserach AS / Routing Research] includes information about determining the number of discrete logical paths in and out of an Autonomous System (AS)&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#TCP_Timeouts_TCP_Timeouts TCP Timeouts] shows some sysctl configuration for adjusting TCP window sizes.&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#Xinetd.2C_ssh_and_netcat_xinetd.2C_ssh_and_netcat xinetd, ssh and netcat] is a xinetd configuration example showing how to use xinetd to trigger ssh / netcat on demand to encrypt pop3 traffic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
... and then of course, the requisite links to the mediawiki docs, hosted at wikipedia:&lt;br /&gt;
&lt;br /&gt;
Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface]&lt;br /&gt;
and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User&amp;#039;s Guide] for usage and configuration help.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=How_to_compile_other_software_using_Macports_libraries&amp;diff=1301</id>
		<title>How to compile other software using Macports libraries</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=How_to_compile_other_software_using_Macports_libraries&amp;diff=1301"/>
				<updated>2009-07-17T00:05:39Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How to compile other software using Macports libraries=&lt;br /&gt;
Audience: Beginner / Intermediate&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This document will attempt to illustrate how to use Macports to fulfill library dependencies of other software that has not been incorporated into Macports. Two examples will be covered here, representing two of the most common way that software is compiled. The first example will demonstrate how to compile a single C source file using gcc directly, linking and including the Macports libraries via the -L and -I gcc command line options. The second example will demonstrate how to link against Macports libraries when compiling software that uses the GNU autoconf system, in which case you do not run gcc directly, but instead pass arguments to the &amp;#039;configure&amp;#039; script.&lt;br /&gt;
&lt;br /&gt;
==Executive Summary and Cheat Sheet==&lt;br /&gt;
&lt;br /&gt;
When using gcc, usually you want to add the following to the list of gcc command line arguments:&lt;br /&gt;
 -I/opt/local/include -L/opt/local/lib&lt;br /&gt;
&lt;br /&gt;
When using autoconf, you usually have a couple options:&lt;br /&gt;
&lt;br /&gt;
1) populate the following environment variables with Macports paths, e.g.&lt;br /&gt;
&lt;br /&gt;
 export LDFLAGS=&amp;#039;-L/opt/local/lib&amp;#039;&lt;br /&gt;
 export CPPFLAGS=&amp;#039;-I/opt/local/include&amp;#039;&lt;br /&gt;
 export LD_LIBRARY_PATH=/opt/local/lib&lt;br /&gt;
 export LD_INCLUDE_PATH=/opt/local/include&lt;br /&gt;
&lt;br /&gt;
2) Pass the required paths as arguments to the configure script. Most configure scripts have specific options for defining the location of dependent libraries; run ./configure --help to see a list of the available options.&lt;br /&gt;
&lt;br /&gt;
==Using Macports libraries with gcc==&lt;br /&gt;
&lt;br /&gt;
In this first example, we will be compiling a simple program that exercises some basic functions of the GMP library, available here: http://gmplib.org/. Since gmp is available via Macports, begin by installing gmp:&lt;br /&gt;
&lt;br /&gt;
 sudo port install gmp&lt;br /&gt;
&lt;br /&gt;
Next, we&amp;#039;ll make a working directory and download the C source file we&amp;#039;ll be compiling, located at http://silassewell.googlecode.com/svn/trunk/2008/10/18/gmp_hello_world/gmp_hello_world.c&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/gmp-test&lt;br /&gt;
 curl -O &lt;br /&gt;
&lt;br /&gt;
Copy the code&lt;br /&gt;
&lt;br /&gt;
Configuration&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
Optional Parts&lt;br /&gt;
&lt;br /&gt;
TODO: What else can be done?&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=How_to_compile_other_software_using_Macports_libraries&amp;diff=1300</id>
		<title>How to compile other software using Macports libraries</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=How_to_compile_other_software_using_Macports_libraries&amp;diff=1300"/>
				<updated>2009-07-16T18:12:20Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: New page: TODO: How to compile other software using Macports libraries Audience: Beginner  Introduction  This document will attempt to illustrate how to use Macports to fulfill library dependencies ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TODO: How to compile other software using Macports libraries&lt;br /&gt;
Audience: Beginner&lt;br /&gt;
&lt;br /&gt;
Introduction&lt;br /&gt;
&lt;br /&gt;
This document will attempt to illustrate how to use Macports to fulfill library dependencies of other software that has not been incorporated into Macports. Two examples will be covered here, representing two of the most common way that software is compiled. The first example will demonstrate how to compile a single C source file using gcc directly, linking and including the Macports libraries via the -L and -I gcc command line options. The second example will demonstrate how to link against Macports libraries when compiling software that uses the GNU autoconf system, in which case you do not run gcc directly, but instead pass arguments to the &amp;#039;configure&amp;#039; script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 1: TODO: Step 1 title&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
Configuration&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
Optional Parts&lt;br /&gt;
&lt;br /&gt;
TODO: What else can be done?&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Main_Page&amp;diff=1299</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Main_Page&amp;diff=1299"/>
				<updated>2009-07-16T17:59:09Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Scripting / Development */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Hey, another wiki. Great! ===&lt;br /&gt;
Here, you will find things. You may notice that anonymous edits are firmly &amp;#039;&amp;#039;&amp;#039;DISABLED&amp;#039;&amp;#039;&amp;#039;. Yeah, THAT&amp;#039;S RIGHT. I am intentionally destroying the communal benefits that wiki was designed to provide. Why? I friggin hate spam, and my two previous wikis were consumed by friggin spambots. You may also notice that you can&amp;#039;t create a user account. COPE! :) If you really want to contribute, please mail me at dreNOSPAMPLSKTHX@mac.com, and I&amp;#039;d be more than happy to let you in.&lt;br /&gt;
&lt;br /&gt;
UPDATE: Even this one got spam-bombed. Note to self: use of &amp;#039;one-click upgrades&amp;#039; are unlikely to migrate configuration file directives when the syntax changes.&lt;br /&gt;
&lt;br /&gt;
Here is the page of [[User:Dre]], your esteemed information broker.&lt;br /&gt;
&lt;br /&gt;
You may want to scope my other, less sandbox-like presence: http://www.dreness.com, or my tech blog: http://www.dreness.com/blog&lt;br /&gt;
&lt;br /&gt;
=== Mac OS X ===&lt;br /&gt;
[[Parallels]] - Wrangling virtual machines!&lt;br /&gt;
&lt;br /&gt;
[[Cool Apps]] - A list of applications that I&amp;#039;ve found useful / cool&lt;br /&gt;
&lt;br /&gt;
[[TigerPage]] - This stuff is all specific to Mac OS X 10.4, Tiger. Some items discussed here:&lt;br /&gt;
*launchd&lt;br /&gt;
*dummynet&lt;br /&gt;
&lt;br /&gt;
[[LKDC]]&lt;br /&gt;
&lt;br /&gt;
=== IT Stuff ===&lt;br /&gt;
I once maintained a FreeBSD box in colo. Check out the page of [[meta]], where I have notes and instructions for the various services I was running.&lt;br /&gt;
&lt;br /&gt;
Rebuilding [[floe]] from OpenBSD to FreeBSD.&lt;br /&gt;
&lt;br /&gt;
[[Mac OS X Server]] stuff.&lt;br /&gt;
&lt;br /&gt;
[[Net SNMP]] items.&lt;br /&gt;
&lt;br /&gt;
=== Scripting / Development ===&lt;br /&gt;
[[Scripting]] - Here&amp;#039;s where I keep a bunch of scripting snippets / examples. This includes:&lt;br /&gt;
*Basic shell scripting idioms (tests, loops, redirection)&lt;br /&gt;
*zsh profile elements&lt;br /&gt;
*AppleScript Droplet example&lt;br /&gt;
*Perl scripts&lt;br /&gt;
&lt;br /&gt;
[[Useful Commands]] - Some useful and often Mac OS X specific commands. So far:&lt;br /&gt;
*Using dd to rescue data from a dying disk&lt;br /&gt;
*Encypted and growable disk images&lt;br /&gt;
*perl one-liner for global find / replace&lt;br /&gt;
*finding the input device idle time from ioreg&lt;br /&gt;
&lt;br /&gt;
[[cocoa]]&lt;br /&gt;
&lt;br /&gt;
[[php]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[bugzilla]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[phpbb]] in OS X&lt;br /&gt;
&lt;br /&gt;
[[rrdtool]] builds without error in 10.3.9&lt;br /&gt;
&lt;br /&gt;
(old) [[Panther DNS Issues]]&lt;br /&gt;
&lt;br /&gt;
[[Installing and using unix software in userland]]&lt;br /&gt;
&lt;br /&gt;
[[How to make and apply patches]]&lt;br /&gt;
&lt;br /&gt;
[[How to compile other software using Macports libraries]]&lt;br /&gt;
&lt;br /&gt;
=== Quick Reference Pages ===&lt;br /&gt;
[[irssi]] [[screen]] [[X11]] [[q3]] [[color escape sequences]] [[mysql]] [[wow]] [http://sial.org/howto/perl/life-with-cpan CPAN notes] [http://meta.wikimedia.org/wiki/Preventing_Access wikimedia security notes] [[vi]] [[apache]] [[iphone]]&lt;br /&gt;
&lt;br /&gt;
=== [[Network Stuff]] ===&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#Streaming_your_iTunes_music_remotely iTunes Remote Streaming] details the process for using iTunes music sharing across a WAN.&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#AS_.2F_Routing_Reserach AS / Routing Research] includes information about determining the number of discrete logical paths in and out of an Autonomous System (AS)&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#TCP_Timeouts_TCP_Timeouts TCP Timeouts] shows some sysctl configuration for adjusting TCP window sizes.&lt;br /&gt;
*[http://www.dreness.com/wikimedia/index.php?title=Network_Stuff#Xinetd.2C_ssh_and_netcat_xinetd.2C_ssh_and_netcat xinetd, ssh and netcat] is a xinetd configuration example showing how to use xinetd to trigger ssh / netcat on demand to encrypt pop3 traffic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
... and then of course, the requisite links to the mediawiki docs, hosted at wikipedia:&lt;br /&gt;
&lt;br /&gt;
Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface]&lt;br /&gt;
and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User&amp;#039;s Guide] for usage and configuration help.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Scripting&amp;diff=1298</id>
		<title>Scripting</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Scripting&amp;diff=1298"/>
				<updated>2009-07-04T19:09:45Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Added mail server testing scripts&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
&lt;br /&gt;
====Redirection====&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;      Redirect standard output&lt;br /&gt;
 2&amp;gt;     Redirect standard error&lt;br /&gt;
 2&amp;gt;&amp;amp;1   Redirect standard error to standard output&lt;br /&gt;
 &amp;lt;      Redirect standard input&lt;br /&gt;
 |      Pipe standard output to another command&lt;br /&gt;
 &amp;gt;&amp;gt;     Append to standard output&lt;br /&gt;
 2&amp;gt;&amp;amp;1|  Pipe standard output and standard error to another command&lt;br /&gt;
 |&amp;amp;     Same as above&lt;br /&gt;
&lt;br /&gt;
====for loop====&lt;br /&gt;
 for file in `ls` &lt;br /&gt;
 do&lt;br /&gt;
 mv $file $file.copy &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====if statement====&lt;br /&gt;
 if [ 1 = 1 ] ; then echo &amp;quot;yes&amp;quot; ; else echo &amp;quot;no&amp;quot; ; fi&lt;br /&gt;
&lt;br /&gt;
====tests==== (for cli args):&lt;br /&gt;
 if ( ! [ $1 ] || [ ! $2 ] ) ; then echo &amp;quot;yup&amp;quot; ; else echo &amp;quot;nope&amp;quot; ; fi&lt;br /&gt;
&lt;br /&gt;
==Practice==&lt;br /&gt;
===Shell scripts===&lt;br /&gt;
&lt;br /&gt;
====Mail Server Testing====&lt;br /&gt;
mailit.sh contains:&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # path comes in as only arg&lt;br /&gt;
 BASE=`basename &amp;quot;$1&amp;quot;`&lt;br /&gt;
 uuencode &amp;quot;$1&amp;quot; $BASE | mail -s $BASE user@domain.com&lt;br /&gt;
&lt;br /&gt;
Then feed it some stuff...&lt;br /&gt;
 find / -name &amp;quot;*.jpg&amp;quot; -print -exec ./mailit.sh {} \;&lt;br /&gt;
&lt;br /&gt;
====Disk Stats====&lt;br /&gt;
(zsh, all one line)&lt;br /&gt;
 x=0 ; df -t hfs,afpfs | grep &amp;quot;/&amp;quot; | awk &amp;#039;{print $2}&amp;#039; | sed &amp;#039;s/G//g&amp;#039; | while read line ;\&lt;br /&gt;
 do x=($line + $x); done ; echo &amp;quot;($x) / 1024 / 1024 / 2&amp;quot; | bc&lt;br /&gt;
&lt;br /&gt;
====Get console idle time====&lt;br /&gt;
 echo $((`ioreg -c IOHIDSystem | sed -e &amp;#039;/HIDIdleTime/ !{ d&amp;#039; -e &amp;#039;t&amp;#039; -e &amp;#039;}&amp;#039; -e &amp;#039;s/.* = //g&amp;#039; -e &amp;#039;q&amp;#039;` / 1000000000))&lt;br /&gt;
&lt;br /&gt;
====Sort all processes in ascending order by process priority====&lt;br /&gt;
 ps auxwwl | tr -s &amp;#039; &amp;#039; | cut -d&amp;#039; &amp;#039; -f14,17-30 | sort -n&lt;br /&gt;
&lt;br /&gt;
====Conditional line printing====&lt;br /&gt;
The following prints only users with UID greater than 500&lt;br /&gt;
 dscl . -list /users uid UniqueID | awk &amp;#039;$2 &amp;gt; 500 { print $1 }&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Or the same thing with perl, using the autosplit feature, -a&lt;br /&gt;
 dscl . -list /users UniqueID | perl -nae &amp;#039;print &amp;quot;$F[0]\n&amp;quot; if $F[1] &amp;gt; 500;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Or the same thing again with perl, using regex:&lt;br /&gt;
 dscl . -list /users UniqueID | perl -ne &amp;#039;$stuff = /^(\w*?)\s*?(\d*?)$/ ; if ( $2 &amp;gt; 500) { print &amp;quot;$1 $2\n&amp;quot; }&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Profile elements====&lt;br /&gt;
The following can be used in a .zshrc or equivalent&lt;br /&gt;
&lt;br /&gt;
=====Dynamic Terminal Window Titles=====&lt;br /&gt;
 case $TERM in &lt;br /&gt;
         vt100*) &lt;br /&gt;
         precmd () {print -Pn &amp;quot;\e]0;%n@%m: %~\a&amp;quot;} &lt;br /&gt;
         ;; &lt;br /&gt;
 esac&lt;br /&gt;
&lt;br /&gt;
=====Fancy prompt=====&lt;br /&gt;
 PS1=&amp;quot;$(print &amp;#039;%{\e[;31m%}%n%{\e[;0m%}@%{\e[;30m%}%m%{\e[0;37m%}[%~]%{\e[0m%}% &amp;#039;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=====Fancy aliases=====&lt;br /&gt;
 alias yak=&amp;quot;yak -Pn \&amp;quot;\e]0;.o0 yak 0o.\a\&amp;quot; ; ssh yak&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Network Connectivity Notifications====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# Ping an IP and do sound effects when our connection state changes.&lt;br /&gt;
# Get PlayBufferedSoundFile here: http://www.snoize.com/Code/PlayBufferedSoundFile.tar.gz&lt;br /&gt;
target=&amp;#039;12.116.25.9&amp;#039;&lt;br /&gt;
status=&amp;#039;online&amp;#039;&lt;br /&gt;
oldstatus=&amp;#039;online&amp;#039;&lt;br /&gt;
while true&lt;br /&gt;
 now=`date`&lt;br /&gt;
 echo &amp;quot;$now = $status&amp;quot;&lt;br /&gt;
 if [[ $status != $oldstatus ]]&lt;br /&gt;
  then if [[ $status == &amp;quot;online&amp;quot; ]] &lt;br /&gt;
   then ~/bin/PlayBufferedSoundFile ~/Documents/sounds/frostnova.aif&lt;br /&gt;
   else ~/bin/PlayBufferedSoundFile ~/Documents/sounds/cs.aif&lt;br /&gt;
  fi&lt;br /&gt;
 fi&lt;br /&gt;
 oldstatus=&amp;quot;$status&amp;quot;&lt;br /&gt;
 sleep 3&lt;br /&gt;
 do ping -t1 -c1 -n $target&amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; status=&amp;quot;online&amp;quot;||status=&amp;quot;offline&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;.&lt;br /&gt;
===AppleScript===&lt;br /&gt;
====Droplet====&lt;br /&gt;
 on open some_items &lt;br /&gt;
        &lt;br /&gt;
  display dialog &amp;quot;Where to, hoss?&amp;quot; buttons {&amp;quot;docroot&amp;quot;, &amp;quot;bits&amp;quot;, &amp;quot;public_html&amp;quot;} default button &amp;quot;bits&amp;quot; &lt;br /&gt;
  set theButton to the button returned of the result &lt;br /&gt;
        &lt;br /&gt;
  if theButton = &amp;quot;bits&amp;quot; then &lt;br /&gt;
   set dest to &amp;quot;andre@dreness.com:/home/websites/dreness/bits&amp;quot; &lt;br /&gt;
  else if theButton = &amp;quot;docroot&amp;quot; then &lt;br /&gt;
   set dest to &amp;quot;andre@dreness.com:/home/websites/dreness&amp;quot; &lt;br /&gt;
  else if theButton = &amp;quot;public_html&amp;quot; then &lt;br /&gt;
   set dest to &amp;quot;andre@dreness.com:~/public_html&amp;quot; &lt;br /&gt;
  else &lt;br /&gt;
   display dialog &amp;quot;no valid choices!&amp;quot; &lt;br /&gt;
  end if &lt;br /&gt;
        &lt;br /&gt;
  repeat with this_item in some_items &lt;br /&gt;
   try &lt;br /&gt;
    do shell script &amp;quot;scp &amp;quot; &amp;amp; quoted form of the POSIX path of this_item &amp;amp; &amp;quot; &amp;quot; &amp;amp; quoted form of dest &lt;br /&gt;
   end try &lt;br /&gt;
  end repeat &lt;br /&gt;
 end open&lt;br /&gt;
&lt;br /&gt;
===Perl===&lt;br /&gt;
====QTSS Stats====&lt;br /&gt;
 #!/usr/bin/perl -w &lt;br /&gt;
 # This is a tiny script to parse QTSS&amp;#039;s server_status to provide a running output of &lt;br /&gt;
 # statistics that is extremely low overhead. Refresh is every 10 seconds, &lt;br /&gt;
 # since that is how often the server_status file is updated by the server &lt;br /&gt;
 # 8/2/03, dre@mac.com &lt;br /&gt;
 #full path of server_status file &lt;br /&gt;
 $statsfile = &amp;quot;/Library/QuickTimeStreaming/Logs/server_status&amp;quot;; &lt;br /&gt;
 while (1) { &lt;br /&gt;
 open(STATS, &amp;quot;$statsfile&amp;quot;);  &lt;br /&gt;
 while ($line = &amp;lt;STATS&amp;gt;) {&lt;br /&gt;
 if ($line =~ /&amp;lt;key&amp;gt;(.*?)&amp;lt;\/key&amp;gt;/) { &lt;br /&gt;
 $storein = &amp;quot;$1&amp;quot;; &lt;br /&gt;
 } elsif ($storein) { &lt;br /&gt;
 $line =~ /&amp;lt;string&amp;gt;(.*?)&amp;lt;\/string&amp;gt;/; &lt;br /&gt;
 $dss_stats{&amp;quot;$storein&amp;quot;} = &amp;quot;$1&amp;quot;; &lt;br /&gt;
 undef $storein; &lt;br /&gt;
 }; &lt;br /&gt;
 }; &lt;br /&gt;
 print `date`; &lt;br /&gt;
 print &amp;quot;Total RTP connections: $dss_stats{qtssRTPSvrTotalConn}\n&amp;quot;; &lt;br /&gt;
 print &amp;quot;Current RTSP / HTTP connections: $dss_stats{qtssRTSPHTTPCurrentSessionCount}\n&amp;quot;; &lt;br /&gt;
 print &amp;quot;Current RTP connections: $dss_stats{qtssRTPSvrCurConn}\n&amp;quot;; &lt;br /&gt;
 $rtp_kbits = sprintf(&amp;quot;%.2f&amp;quot;, ($dss_stats{qtssRTPSvrCurBandwidth} / 1000)); &lt;br /&gt;
 $rtp_mbits = sprintf(&amp;quot;%.2f&amp;quot;, ($rtp_kbits / 1000)); &lt;br /&gt;
 print &amp;quot;Current RTP bandwidth $rtp_kbits Kbit/s ($rtp_mbits Mbit/s)\n&amp;quot;; &lt;br /&gt;
 print &amp;quot;Current RTP packets: $dss_stats{qtssRTPSvrCurPackets}\n&amp;quot;; &lt;br /&gt;
 $rtp_bytes = $dss_stats{qtssRTPSvrTotalBytes}; &lt;br /&gt;
 $rtp_megs = ($dss_stats{qtssRTPSvrTotalBytes} / 1024 / 1024); &lt;br /&gt;
 $rtp_megs = sprintf(&amp;quot;%.2f&amp;quot;, $rtp_megs); &lt;br /&gt;
 $rtp_gigs = ($rtp_megs / 1024); &lt;br /&gt;
 $rtp_gigs = sprintf(&amp;quot;%.2f&amp;quot;, $rtp_gigs); &lt;br /&gt;
 print &amp;quot;Total RTP bytes transfered: $rtp_bytes ($rtp_megs MB, $rtp_gigs GB)\n&amp;quot;; &lt;br /&gt;
 close(STATS); &lt;br /&gt;
 print &amp;quot;\n&amp;quot;; &lt;br /&gt;
 sleep 10; &lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
====SSH Tunnel Watcher====&lt;br /&gt;
 #!/usr/bin/perl&lt;br /&gt;
 if ( `ps x | grep &amp;quot;ssh -L 2501:local:25&amp;quot; | grep -v grep` ) { &lt;br /&gt;
         print &amp;quot;local mail ssh tunnel running okay! n&amp;quot;; &lt;br /&gt;
         } else { &lt;br /&gt;
         print &amp;quot;reloading... n&amp;quot;; &lt;br /&gt;
         system(&amp;quot;ssh -L 2501:local:25 -f -N local&amp;quot;); &lt;br /&gt;
 };&lt;br /&gt;
 if ( `ps x | grep &amp;quot;ssh -L 2500:local:2501&amp;quot; | grep -v grep` ) { &lt;br /&gt;
         print &amp;quot;public mail ssh tunnel running okay! n&amp;quot;; &lt;br /&gt;
         } else { &lt;br /&gt;
         print &amp;quot;reloading... n&amp;quot;; &lt;br /&gt;
         system(&amp;quot;ssh -L 2500:local:2501 -f -N -g local&amp;quot;); &lt;br /&gt;
 };&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Useful_Commands&amp;diff=1297</id>
		<title>Useful Commands</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Useful_Commands&amp;diff=1297"/>
				<updated>2009-06-21T00:54:02Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: added mailit script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Rsync ====&lt;br /&gt;
Use it just like scp for maximum ease! We will add the -avz flags for&lt;br /&gt;
 -a = archive, preserve metadata&lt;br /&gt;
 -v = verbose&lt;br /&gt;
 -z = use compression (most useful across slow network links)&lt;br /&gt;
 -P = &amp;#039;partial&amp;#039; mode; stores partially transfered files so you can resume if needed&lt;br /&gt;
&lt;br /&gt;
The following copies the local directory /some/stuff into a directory called &amp;#039;stuff&amp;#039; in the user&amp;#039;s home dir on the remote host.&lt;br /&gt;
 rsync -avzP /some/stuff user@remote.host:stuff&lt;br /&gt;
&lt;br /&gt;
To go in the other direction, use the form:&lt;br /&gt;
 rsync -avP user@host.com:&amp;#039;/dir/1 /dir/2&amp;#039; /local/path&lt;br /&gt;
&lt;br /&gt;
====Data rescue====&lt;br /&gt;
Have a dying disk? Better get the data off before it&amp;#039;s too late! disk1 is the culprit in this example.&lt;br /&gt;
 dd conv=noerror,sync if=/dev/disk1 of=/Volumes/whatever/backup.dmg&lt;br /&gt;
&lt;br /&gt;
====Zip files with resource forks====&lt;br /&gt;
 ditto -c -k --keepParent aFolder aFolder.zip&lt;br /&gt;
&lt;br /&gt;
====Encrypted and growable (sparse) disk image====&lt;br /&gt;
(-size specifies max growth)&lt;br /&gt;
 hdiutil create dmg_name -size 1g -encryption -type SPARSE -fs HFS+ -volname Vault&lt;br /&gt;
&lt;br /&gt;
====Global find / replace====&lt;br /&gt;
 perl -pi -e &amp;#039;s/foo/bar/g&amp;#039; file&lt;br /&gt;
 perl -pi -e &amp;#039;s/mandir=\&amp;#039;\${prefix}\/man\&amp;#039;/mandir=\&amp;#039;\${prefix}\/share\/man\&amp;#039;/g&amp;#039; configure&lt;br /&gt;
&lt;br /&gt;
====Disk Stats==== (zsh)&lt;br /&gt;
 echo -n &amp;quot;Sum of all HFS and AFP volumes in gigs: &amp;quot; ; x=0 ; df -t hfs,afpfs | grep &amp;quot;/&amp;quot; \&lt;br /&gt;
 | awk &amp;#039;{print $2}&amp;#039; | sed &amp;#039;s/G//g&amp;#039; | while read line ; do x=($line + $x); done ; echo &amp;quot;($x) / 1024 / 1024 / 2&amp;quot; | bc&lt;br /&gt;
&lt;br /&gt;
====Get console idle time====&lt;br /&gt;
 echo $((`ioreg -c IOHIDSystem | sed -e &amp;#039;/HIDIdleTime/ !{ d&amp;#039; -e &amp;#039;t&amp;#039; -e &amp;#039;}&amp;#039; -e &amp;#039;s/.* = //g&amp;#039; -e &amp;#039;q&amp;#039;` / 1000000000))&lt;br /&gt;
&lt;br /&gt;
====System Tuning====&lt;br /&gt;
Any of these can be set manually with:&lt;br /&gt;
 sudo sysctl -w sysctl.key=value&lt;br /&gt;
&lt;br /&gt;
Place the following in /etc/sysctl.conf and reboot to boost your limits&lt;br /&gt;
 # values increased by 2x over defaults&lt;br /&gt;
 kern.maxfiles=24576&lt;br /&gt;
 kern.maxfilesperproc=20480&lt;br /&gt;
 kern.maxprocperuid=200&lt;br /&gt;
 kern.maxproc=1064&lt;br /&gt;
&lt;br /&gt;
====debugging / hidden preferences====&lt;br /&gt;
=====iChat Logging=====&lt;br /&gt;
 defaults write com.apple.iChat Log YES&lt;br /&gt;
 defaults write com.apple.iChat Log.SecureIM YES&lt;br /&gt;
 defaults write com.apple.iChatAgent Log YES&lt;br /&gt;
 defaults write com.apple.iChatAgent Log.SecureIM YES&lt;br /&gt;
 /Applications/iChat.app/Contents/MacOS/iChat -errorLogLevel 7&lt;br /&gt;
&lt;br /&gt;
=====Mail logging=====&lt;br /&gt;
 /Applications/Mail.app/Contents/MacOS/Mail -LogActivityOnHost bar.company.com&lt;br /&gt;
&lt;br /&gt;
=====Screen Saver=====&lt;br /&gt;
 defaults -currentHost write com.apple.screensaver askForPassword -boolean true&lt;br /&gt;
 defaults -currentHost write com.apple.screensaver moduleName -string foo&lt;br /&gt;
 defaults -currentHost write com.apple.screensaver modulePath -string &amp;quot;~/Library/Screen Savers/foo.saver&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Mail Server Testing====&lt;br /&gt;
Use this to generate a bunch of messages with attachments.&lt;br /&gt;
&lt;br /&gt;
 find / -name &amp;quot;*.jpg&amp;quot; -print -exec ./mailit.sh {} \;&lt;br /&gt;
&lt;br /&gt;
with mailit.sh containing the following. Edit the email address as needed.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # path comes in as only arg&lt;br /&gt;
 BASE=`basename &amp;quot;$1&amp;quot;`&lt;br /&gt;
 uuencode &amp;quot;$1&amp;quot; $BASE | mail -s $BASE netuser1@server100.4952&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1296</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1296"/>
				<updated>2009-05-03T21:16:02Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: removed old content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Macros=&lt;br /&gt;
(many of these are outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /use 13 &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
=Videography=&lt;br /&gt;
&lt;br /&gt;
==Camera Control==&lt;br /&gt;
&lt;br /&gt;
Nice camera moves are best achieved by the game itself, as it&amp;#039;s basically impossible to match the smooth motion curves with any sort of human input device. One way to do this is to use the camera presets. By default, the speed at which the camera moves between presets is pretty quick - good for in-game use, but not good for cinematic purposes. You can adjust the camera movement speed by altering the time duration of the transition, using a couple of cvars. They are:&lt;br /&gt;
&lt;br /&gt;
 cameraSmoothTimeMax&lt;br /&gt;
 cameraSmoothTimeMin&lt;br /&gt;
&lt;br /&gt;
* in a slash command context:&lt;br /&gt;
 /console SET cameraSmoothTimeMax 15.0&lt;br /&gt;
 /console SET cameraSmoothTimeMin 15.0&lt;br /&gt;
&lt;br /&gt;
* in a script context:&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,&amp;quot;15&amp;quot;)&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,&amp;quot;15&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
* or you can set both at once using a function for ease-of-use. You&amp;#039;d need to slap this in a macro (or some existing mod) then execute it once to declare the function before you can use it. This function will let you more easily adjust the camera speed (less typing).&lt;br /&gt;
 /script function cam(s) SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,s) SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,s) end&lt;br /&gt;
&lt;br /&gt;
After running the above to declare the function, use the function as shown below. 10 is the duration of the camera preset transition in seconds, but it can be whatever you want. Awesome for videos :)&lt;br /&gt;
 /script cam(10)&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1295</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1295"/>
				<updated>2009-05-03T20:41:10Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Camera Control */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP / PVE: 8 -10-53]&lt;br /&gt;
&lt;br /&gt;
PVP focus with some PVE utility; no mana tide, has elemental warding, instant ghost wolf, improved shields&lt;br /&gt;
&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP: 0-20-51]&lt;br /&gt;
&lt;br /&gt;
Pure arena build, includes improved shields, shamanistic focus, guardian totems and 2 / 5 toughness, with 2 points shaved from the top end of Resto. More crit than the 8 / 10 / 53 build. No mana tide.&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;br /&gt;
&lt;br /&gt;
=Videography=&lt;br /&gt;
&lt;br /&gt;
==Camera Control==&lt;br /&gt;
&lt;br /&gt;
Nice camera moves are best achieved by the game itself, as it&amp;#039;s basically impossible to match the smooth motion curves with any sort of human input device. One way to do this is to use the camera presets. By default, the speed at which the camera moves between presets is pretty quick - good for in-game use, but not good for cinematic purposes. You can adjust the camera movement speed by altering the time duration of the transition, using a couple of cvars. They are:&lt;br /&gt;
&lt;br /&gt;
 cameraSmoothTimeMax&lt;br /&gt;
 cameraSmoothTimeMin&lt;br /&gt;
&lt;br /&gt;
* in a slash command context:&lt;br /&gt;
 /console SET cameraSmoothTimeMax 15.0&lt;br /&gt;
 /console SET cameraSmoothTimeMin 15.0&lt;br /&gt;
&lt;br /&gt;
* in a script context:&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,&amp;quot;15&amp;quot;)&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,&amp;quot;15&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
* or you can set both at once using a function for ease-of-use. You&amp;#039;d need to slap this in a macro (or some existing mod) then execute it once to declare the function before you can use it. This function will let you more easily adjust the camera speed (less typing).&lt;br /&gt;
 /script function cam(s) SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,s) SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,s) end&lt;br /&gt;
&lt;br /&gt;
After running the above to declare the function, use the function as shown below. 10 is the duration of the camera preset transition in seconds, but it can be whatever you want. Awesome for videos :)&lt;br /&gt;
 /script cam(10)&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1294</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1294"/>
				<updated>2009-05-03T20:39:03Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Camera Control */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP / PVE: 8 -10-53]&lt;br /&gt;
&lt;br /&gt;
PVP focus with some PVE utility; no mana tide, has elemental warding, instant ghost wolf, improved shields&lt;br /&gt;
&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP: 0-20-51]&lt;br /&gt;
&lt;br /&gt;
Pure arena build, includes improved shields, shamanistic focus, guardian totems and 2 / 5 toughness, with 2 points shaved from the top end of Resto. More crit than the 8 / 10 / 53 build. No mana tide.&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;br /&gt;
&lt;br /&gt;
=Videography=&lt;br /&gt;
&lt;br /&gt;
==Camera Control==&lt;br /&gt;
&lt;br /&gt;
Nice camera moves are best achieved by the game itself, as it&amp;#039;s basically impossible to match the smooth motion curves with any sort of human input device. One way to do this is to use the camera presets. By default, the speed at which the camera moves between presets is pretty quick - good for in-game use, but not good for cinematic purposes. You can adjust the camera movement speed by altering the time duration of the transition, using a couple of cvars. They are:&lt;br /&gt;
&lt;br /&gt;
 cameraSmoothTimeMax&lt;br /&gt;
 cameraSmoothTimeMin&lt;br /&gt;
&lt;br /&gt;
* in a slash command context:&lt;br /&gt;
 /console SET cameraSmoothTimeMax 15.0&lt;br /&gt;
 /console SET cameraSmoothTimeMin 15.0&lt;br /&gt;
&lt;br /&gt;
* in a script context:&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,&amp;quot;15&amp;quot;)&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,&amp;quot;15&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
* or you can set both at once using a function for ease-of-use. You&amp;#039;d need to slap this in a macro (or some existing mod) then execute it in before you can use the function. The idea is that this function will let you easily adjust the speed using a short-hand.&lt;br /&gt;
 /script function cam(s) SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,s) SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,s) end&lt;br /&gt;
&lt;br /&gt;
Use the function as shown below. 10 is the duration of the camera preset transition in seconds, but it can be whatever you want. Awesome for videos :)&lt;br /&gt;
 /script cam(10)&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1293</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1293"/>
				<updated>2009-05-03T20:38:38Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: added camera control&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP / PVE: 8 -10-53]&lt;br /&gt;
&lt;br /&gt;
PVP focus with some PVE utility; no mana tide, has elemental warding, instant ghost wolf, improved shields&lt;br /&gt;
&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP: 0-20-51]&lt;br /&gt;
&lt;br /&gt;
Pure arena build, includes improved shields, shamanistic focus, guardian totems and 2 / 5 toughness, with 2 points shaved from the top end of Resto. More crit than the 8 / 10 / 53 build. No mana tide.&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;br /&gt;
&lt;br /&gt;
=Videography=&lt;br /&gt;
&lt;br /&gt;
==Camera Control==&lt;br /&gt;
&lt;br /&gt;
Nice camera moves are best achieved by the game itself, as it&amp;#039;s basically impossible to match the smooth motion curves with any sort of human input device. One way to do this is to use the camera presets. By default, the speed at which the camera moves between presets is pretty quick - good for in-game use, but not good for cinematic purposes. You can adjust the camera movement speed by altering the time duration of the transition, using a couple of cvars. They are:&lt;br /&gt;
&lt;br /&gt;
 cameraSmoothTimeMax&lt;br /&gt;
 cameraSmoothTimeMin&lt;br /&gt;
&lt;br /&gt;
# in a slash command context:&lt;br /&gt;
 /console SET cameraSmoothTimeMax 15.0&lt;br /&gt;
 /console SET cameraSmoothTimeMin 15.0&lt;br /&gt;
&lt;br /&gt;
# in a script context:&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,&amp;quot;15&amp;quot;)&lt;br /&gt;
 SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,&amp;quot;15&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
# or you can set both at once using a function for ease-of-use. You&amp;#039;d need to slap this in a macro (or some existing mod) then execute it in before you can use the function. The idea is that this function will let you easily adjust the speed using a short-hand.&lt;br /&gt;
 /script function cam(s) SetCVar(&amp;quot;cameraSmoothTimeMax&amp;quot;,s) SetCVar(&amp;quot;cameraSmoothTimeMin&amp;quot;,s) end&lt;br /&gt;
&lt;br /&gt;
Use the function as shown below. 10 is the duration of the camera preset transition in seconds, but it can be whatever you want. Awesome for videos :)&lt;br /&gt;
 /script cam(10)&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Screen&amp;diff=1292</id>
		<title>Screen</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Screen&amp;diff=1292"/>
				<updated>2009-02-28T09:18:13Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: added C-a ] for normal paste&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Basics ===&lt;br /&gt;
&lt;br /&gt;
Control-a (C-a) is screen attention sequence and preceeds all screen commands. For example, to create a new screen window, type control-a, then c. To clarify even further: hold control, type a, release control, press c.&lt;br /&gt;
&lt;br /&gt;
 c         = new window&lt;br /&gt;
 k         = kill current window&lt;br /&gt;
 d         = detach from screen&lt;br /&gt;
 ?         = show online help&lt;br /&gt;
&lt;br /&gt;
From outside of the screen session:&lt;br /&gt;
 screen -R = reattach&lt;br /&gt;
 screen -x = multi-attach&lt;br /&gt;
&lt;br /&gt;
=== caption and hardstatus ===&lt;br /&gt;
I use the following with Terminal&amp;#039;s color scheme set to green on black:&lt;br /&gt;
 caption always &amp;quot;%{Mk}%?%-Lw%?%{km}[%n*%f %t]%?(%u)%?%{mk}%?%+Lw%? %{mk}&amp;quot;&lt;br /&gt;
 hardstatus alwayslastline &amp;quot;%{kW}%H %{kB}|%{km} %l %=%{km}%c:%s %D %M/%d/%Y &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Navigation ===&lt;br /&gt;
 &amp;quot;         = list window names, numbers, and flags&lt;br /&gt;
 N         = show current window number&lt;br /&gt;
 A         = set window name&lt;br /&gt;
 &amp;#039;         = specify name or number to switch to&lt;br /&gt;
 space     = next window&lt;br /&gt;
 backspace = prev window&lt;br /&gt;
 #         = goto window number #&lt;br /&gt;
 w         = show window list in status bar&lt;br /&gt;
 C-a       = switch to most recent window&lt;br /&gt;
&lt;br /&gt;
=== Split Windows ===&lt;br /&gt;
 S         = create split in current region&lt;br /&gt;
 tab       = move to next region&lt;br /&gt;
 X         = delete current region&lt;br /&gt;
 Q         = delete all but current region&lt;br /&gt;
&lt;br /&gt;
=== Monitoring ===&lt;br /&gt;
 M         = toggle activity monitor notifications in status bar&lt;br /&gt;
 _         = toggle INactivity monitor notification in status bar (e.g. for when something&amp;#039;s done compiling)&lt;br /&gt;
 m         = recall last message displayed in status bar&lt;br /&gt;
 C-g       = toggle audio / visual bell&lt;br /&gt;
 t         = show time / load average&lt;br /&gt;
&lt;br /&gt;
=== Scrollback / copy mode movement keys ===&lt;br /&gt;
&lt;br /&gt;
 [       = enter copy mode&lt;br /&gt;
         h, j, k, l move the cursor line by line or column by column.&lt;br /&gt;
         0,  ^  and  $  move to the leftmost column, to the first or last non-&lt;br /&gt;
           whitespace character on the line.&lt;br /&gt;
         H, M and L move the cursor to the leftmost column of the top,  center&lt;br /&gt;
           or bottom line of the window.&lt;br /&gt;
         + and - positions one line up and down.&lt;br /&gt;
         G moves to the specified absolute line (default: end of buffer).&lt;br /&gt;
         | moves to the specified absolute column.&lt;br /&gt;
         w, b, e move the cursor word by word.&lt;br /&gt;
         B, E move the cursor WORD by WORD (as in vi).&lt;br /&gt;
         C-u  and  C-d  scroll  the display up/down by the specified amount of&lt;br /&gt;
           lines while preserving the cursor position. (Default: half  screen-&lt;br /&gt;
           full).&lt;br /&gt;
         C-b and C-f scroll the display up/down a full screen.&lt;br /&gt;
         g moves to the beginning of the buffer.&lt;br /&gt;
         % jumps to the specified percentage of the buffer.&lt;br /&gt;
&lt;br /&gt;
===Pasteboard===&lt;br /&gt;
Paste the contents of the pasteboard&lt;br /&gt;
 C-a ]&lt;br /&gt;
&lt;br /&gt;
Read the /etc/passwd file into register p and paste it back out&lt;br /&gt;
 C-a : readreg p /etc/passwd&lt;br /&gt;
 C-a : paste p&lt;br /&gt;
&lt;br /&gt;
 Marking:&lt;br /&gt;
   The  copy range is specified by setting two marks. The text between&lt;br /&gt;
   these marks will be highlighted. Press&lt;br /&gt;
   space to set the first or second mark respectively.&lt;br /&gt;
   Y and y used to mark one whole line or to mark from start of line.&lt;br /&gt;
   W marks exactly one word.&lt;br /&gt;
 Repeat count:&lt;br /&gt;
   Any of these commands can be prefixed with a repeat count number by&lt;br /&gt;
   pressing digits 0..9 which is taken as a repeat count.&lt;br /&gt;
   Example:  &amp;quot;C-a  C-[  H  10 j 5 Y&amp;quot; will copy lines 11 to 15 into the&lt;br /&gt;
   paste buffer.&lt;br /&gt;
 Searching:&lt;br /&gt;
   / Vi-like search forward.&lt;br /&gt;
   ? Vi-like search backward.&lt;br /&gt;
   C-a s Emacs style incremental search forward.&lt;br /&gt;
   C-r Emacs style reverse i-search.&lt;br /&gt;
 Specials:&lt;br /&gt;
   There are however some keys that act differently than  in  vi.   Vi&lt;br /&gt;
   does  not  allow one to yank rectangular blocks of text, but screen&lt;br /&gt;
   does. Press c or C to set the left or right margin  respectively.  If  no  repeat&lt;br /&gt;
   count is given, both default to the current cursor position.&lt;br /&gt;
   Example: Try this on a rather full text screen: &amp;quot;C-a [ M 20 l SPACE&lt;br /&gt;
   c 10 l 5 j C SPACE&amp;quot;.&lt;br /&gt;
   This moves one to the middle line of the screen, moves in  20  col-&lt;br /&gt;
   umns  left,  marks the beginning of the paste buffer, sets the left&lt;br /&gt;
   column, moves 5 columns down, sets the right column, and then marks&lt;br /&gt;
   the end of the paste buffer. Now try:&lt;br /&gt;
   &amp;quot;C-a [ M 20 l SPACE 10 l 5 j SPACE&amp;quot;&lt;br /&gt;
   and notice the difference in the amount of text copied.&lt;br /&gt;
  J  joins lines. It toggles between 4 modes: lines separated by a new-&lt;br /&gt;
    line character (012), lines glued seamless, lines  separated  by  a&lt;br /&gt;
   single  whitespace  and  comma  separated  lines. Note that you can&lt;br /&gt;
   prepend the newline character with a carriage return character,  by&lt;br /&gt;
   issuing a &amp;quot;crlf on&amp;quot;.&lt;br /&gt;
  v  is  for all the vi users with &amp;quot;:set numbers&amp;quot; - it toggles the left&lt;br /&gt;
   margin between column 9 and 1. Press&lt;br /&gt;
   a before the final space key to toggle in append mode. Thus the  con-&lt;br /&gt;
   tents  of the paste buffer will not be overwritten, but is appended&lt;br /&gt;
   to.&lt;br /&gt;
  A toggles in append mode and sets a (second) mark.&lt;br /&gt;
   &amp;gt; sets the (second) mark and writes the contents of the paste  buffer&lt;br /&gt;
   to the screen-exchange file (/tmp/screen-exchange per default) once&lt;br /&gt;
   copy-mode is finished.&lt;br /&gt;
   This example demonstrates how to dump the whole  scrollback  buffer&lt;br /&gt;
   to that file: &amp;quot;C-A [ g SPACE G $ &amp;gt;&amp;quot;.&lt;br /&gt;
   C-g gives information about the current line and column.&lt;br /&gt;
  x  exchanges  the first mark and the current cursor position. You can&lt;br /&gt;
   use this to adjust an already placed mark.&lt;br /&gt;
  @ does nothing. Does not even exit copy mode.&lt;br /&gt;
   All keys not described here exit copy mode.&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
Commands can exist in .screenrc or can be entered interactively with C-a, :&lt;br /&gt;
&lt;br /&gt;
send the &amp;#039;whoami&amp;#039; command to all screen windows simultaneously (\015 is octal for carriage return)&lt;br /&gt;
 at \# stuff &amp;quot;whoami\015&amp;quot;&lt;br /&gt;
&lt;br /&gt;
back to [[Main Page]]&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Useful_Commands&amp;diff=1290</id>
		<title>Useful Commands</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Useful_Commands&amp;diff=1290"/>
				<updated>2009-01-31T21:26:58Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: added -P for partials&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Rsync ====&lt;br /&gt;
Use it just like scp for maximum ease! We will add the -avz flags for&lt;br /&gt;
 -a = archive, preserve metadata&lt;br /&gt;
 -v = verbose&lt;br /&gt;
 -z = use compression (most useful across slow network links)&lt;br /&gt;
 -P = &amp;#039;partial&amp;#039; mode; stores partially transfered files so you can resume if needed&lt;br /&gt;
&lt;br /&gt;
The following copies the local directory /some/stuff into a directory called &amp;#039;stuff&amp;#039; in the user&amp;#039;s home dir on the remote host.&lt;br /&gt;
 rsync -avzP /some/stuff user@remote.host:stuff&lt;br /&gt;
&lt;br /&gt;
To go in the other direction, use the form:&lt;br /&gt;
 rsync -avP user@host.com:&amp;#039;/dir/1 /dir/2&amp;#039; /local/path&lt;br /&gt;
&lt;br /&gt;
====Data rescue====&lt;br /&gt;
Have a dying disk? Better get the data off before it&amp;#039;s too late! disk1 is the culprit in this example.&lt;br /&gt;
 dd conv=noerror,sync if=/dev/disk1 of=/Volumes/whatever/backup.dmg&lt;br /&gt;
&lt;br /&gt;
====Zip files with resource forks====&lt;br /&gt;
 ditto -c -k --keepParent aFolder aFolder.zip&lt;br /&gt;
&lt;br /&gt;
====Encrypted and growable (sparse) disk image====&lt;br /&gt;
(-size specifies max growth)&lt;br /&gt;
 hdiutil create dmg_name -size 1g -encryption -type SPARSE -fs HFS+ -volname Vault&lt;br /&gt;
&lt;br /&gt;
====Global find / replace====&lt;br /&gt;
 perl -pi -e &amp;#039;s/foo/bar/g&amp;#039; file&lt;br /&gt;
 perl -pi -e &amp;#039;s/mandir=\&amp;#039;\${prefix}\/man\&amp;#039;/mandir=\&amp;#039;\${prefix}\/share\/man\&amp;#039;/g&amp;#039; configure&lt;br /&gt;
&lt;br /&gt;
====Disk Stats==== (zsh)&lt;br /&gt;
 echo -n &amp;quot;Sum of all HFS and AFP volumes in gigs: &amp;quot; ; x=0 ; df -t hfs,afpfs | grep &amp;quot;/&amp;quot; \&lt;br /&gt;
 | awk &amp;#039;{print $2}&amp;#039; | sed &amp;#039;s/G//g&amp;#039; | while read line ; do x=($line + $x); done ; echo &amp;quot;($x) / 1024 / 1024 / 2&amp;quot; | bc&lt;br /&gt;
&lt;br /&gt;
====Get console idle time====&lt;br /&gt;
 echo $((`ioreg -c IOHIDSystem | sed -e &amp;#039;/HIDIdleTime/ !{ d&amp;#039; -e &amp;#039;t&amp;#039; -e &amp;#039;}&amp;#039; -e &amp;#039;s/.* = //g&amp;#039; -e &amp;#039;q&amp;#039;` / 1000000000))&lt;br /&gt;
&lt;br /&gt;
====System Tuning====&lt;br /&gt;
Any of these can be set manually with:&lt;br /&gt;
 sudo sysctl -w sysctl.key=value&lt;br /&gt;
&lt;br /&gt;
Place the following in /etc/sysctl.conf and reboot to boost your limits&lt;br /&gt;
 # values increased by 2x over defaults&lt;br /&gt;
 kern.maxfiles=24576&lt;br /&gt;
 kern.maxfilesperproc=20480&lt;br /&gt;
 kern.maxprocperuid=200&lt;br /&gt;
 kern.maxproc=1064&lt;br /&gt;
&lt;br /&gt;
====debugging / hidden preferences====&lt;br /&gt;
=====iChat Logging=====&lt;br /&gt;
 defaults write com.apple.iChat Log YES&lt;br /&gt;
 defaults write com.apple.iChat Log.SecureIM YES&lt;br /&gt;
 defaults write com.apple.iChatAgent Log YES&lt;br /&gt;
 defaults write com.apple.iChatAgent Log.SecureIM YES&lt;br /&gt;
 /Applications/iChat.app/Contents/MacOS/iChat -errorLogLevel 7&lt;br /&gt;
&lt;br /&gt;
=====Mail logging=====&lt;br /&gt;
 /Applications/Mail.app/Contents/MacOS/Mail -LogActivityOnHost bar.company.com&lt;br /&gt;
&lt;br /&gt;
=====Screen Saver=====&lt;br /&gt;
 defaults -currentHost write com.apple.screensaver askForPassword -boolean true&lt;br /&gt;
 defaults -currentHost write com.apple.screensaver moduleName -string foo&lt;br /&gt;
 defaults -currentHost write com.apple.screensaver modulePath -string &amp;quot;~/Library/Screen Savers/foo.saver&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1289</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1289"/>
				<updated>2008-12-23T20:32:34Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Talent Builds */ formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP / PVE: 8 -10-53]&lt;br /&gt;
&lt;br /&gt;
PVP focus with some PVE utility; no mana tide, has elemental warding, instant ghost wolf, improved shields&lt;br /&gt;
&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP: 0-20-51]&lt;br /&gt;
&lt;br /&gt;
Pure arena build, includes improved shields, shamanistic focus, guardian totems and 2 / 5 toughness, with 2 points shaved from the top end of Resto. More crit than the 8 / 10 / 53 build. No mana tide.&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1288</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1288"/>
				<updated>2008-12-23T20:31:56Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Talent Builds */  formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP / PVE 8 / 10 / 53]&lt;br /&gt;
&lt;br /&gt;
PVP focus with some PVE utility; no mana tide, has elemental warding, instant ghost wolf, improved shields&lt;br /&gt;
&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP 0 / 20 / 51]&lt;br /&gt;
&lt;br /&gt;
Pure arena build, includes improved shields, shamanistic focus, guardian totems and 2 / 5 toughness, with 2 points shaved from the top end of Resto. More crit than the 8 / 10 / 53 build. No mana tide.&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1287</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1287"/>
				<updated>2008-12-23T20:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Talent Builds */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP / PVE]&lt;br /&gt;
&lt;br /&gt;
8 / 10 / 53&lt;br /&gt;
PVP focus with some PVE utility; no mana tide, has elemental warding, instant ghost wolf, improved shields&lt;br /&gt;
&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP]&lt;br /&gt;
0 / 20 / 51&lt;br /&gt;
Pure arena build, includes improved shields, shamanistic focus, guardian totems and 2 / 5 toughness, with 2 points shaved from the top end of Resto. More crit than the 8 / 10 / 53 build. No mana tide.&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1286</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1286"/>
				<updated>2008-12-23T20:28:22Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Talent Builds */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP / PVE]&lt;br /&gt;
&lt;br /&gt;
8 / 10 / 53&lt;br /&gt;
PVP focus with some PVE utility; no mana tide, has elemental warding, instant ghost wolf, improved shields&lt;br /&gt;
&lt;br /&gt;
* [http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP]&lt;br /&gt;
0 / 20 / 51&lt;br /&gt;
Pure PVP build includes improved shields, shamanistic focus, guardian totems and 2 / 5 toughness, with 2 points shaved from the top end of Resto&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1285</id>
		<title>Wow</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Wow&amp;diff=1285"/>
				<updated>2008-12-23T19:49:21Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Added talent builds section, link to pvp build&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talent Builds=&lt;br /&gt;
[http://www.worldofwarcraft.com/info/classes/shaman/talents.html?tal=050300000000000000000000005002300000000000000000000050035331001013550120331251 Resto Shaman PVP]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Macros=&lt;br /&gt;
(these are all outdated)&lt;br /&gt;
&lt;br /&gt;
==Offensive==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;castsequence&amp;quot; is a great new addition to the macro language that lets you assign a sequence of things to a single key. Each press (after the global cooldown) gets you the next item in the list. When you hit the end, it automatically wraps back around. I also add a reset timer so that it jumps back to the beginning, because mana spring doesn&amp;#039;t last as long as the others, so I typically have to re-cast it more often. Also, the /shift means that reset is triggered after 25 seconds, or if I shift-click the macro button (allowing me to bypass the 25 second timer if I need to).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;cast&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Mana Spring Totem, Wrath of Air Totem, Totem of Wrath, Strength of Earth Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mele&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=25/shift Grace of Air Totem, Strength of Earth Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
Adding a [button:2] clause acts as a conditional that is only true if the macro was invoked with (in this case) a right-click. Depending on your mouse, you may also have additional buttons (3, 4, 5). I right-click for a rank 1 when I  want to do is get the secondary effect of the spell (e.g. slow target, prevent stealth, interrupt spells, reveal stealthed players in mele range) without spending a lot of mana.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;frs&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Frost Shock(Rank 1) ; Frost Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;fls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Flame Shock(Rank 1) ; Flame Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;es&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Earth Shock(Rank 1) ; Earth Shock&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;magma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Magma Totem(Rank 1) ; Magma Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;flash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=10 Flametongue Weapon, Frostbrand Weapon&lt;br /&gt;
&lt;br /&gt;
This one&amp;#039;s silly... looks sorta cool to just spam it while running around town, but it&amp;#039;s also a useful toggle when your target is immune to either flame or frost damage. As an ele shaman, you probably want flametongue by default as it gets your +spell damage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;chain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat, button:2] Chain Heal; [help, nocombat, button:2] Chain Heal;&lt;br /&gt;
 [target=targettarget, help, combat, button:2] Chain Heal;&lt;br /&gt;
 [target=player, button:2] Chain Heal; Chain Lightning&lt;br /&gt;
&lt;br /&gt;
This is used for either a chain lightning or a chain heal. Normal click is chain lightning, but a right click gives it a hw like behavior (see below), but with chain heal instead of healing wave.&lt;br /&gt;
&lt;br /&gt;
==Defensive==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;clean&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=shift Poison Cleansing Totem, Disease Cleansing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;def&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Grounding Totem, Tremor Totem, Healing Stream Totem, Totem of Wrath&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=15/shift Earthbind Totem, Grounding Totem, Searing Totem&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;resist&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /castsequence reset=20/shift Nature Resistance Totem, Frost Resistance Totem, Fire Resistance Totem, Stoneskin Totem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [button:2] Nature&amp;#039;s Swiftness; [help, combat] Healing Wave; [help, nocombat] Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Healing Wave; [target=player] Healing Wave&lt;br /&gt;
I like this one a lot, but can&amp;#039;t take credit for writing it, though I did add the NS bit. Right click it to proc Nature&amp;#039;s Swiftness; left-click does one of the following: If your target is friendly, heal it (whether in combat or not). If your target&amp;#039;s target is friendly and you are in combat, heal your target&amp;#039;s target. This is the key clause here; it allows you to dps a target and also heal the target&amp;#039;s target (e.g. your tank or yourself) without changing your own target first. Finally, if none of the above is true, heal yourself. To get a fast heal, do a rapid right-click left-click... works great, and is so fast that nobody would have time to dispell the NS before the big heal pops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;lhw&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast [help, combat] Lesser Healing Wave; [help, nocombat] Lesser Healing Wave;&lt;br /&gt;
 [target=targettarget, help, combat] Lesser Healing Wave; [target=player] Lesser Healing Wave&lt;br /&gt;
&lt;br /&gt;
Same as above, but with lesser healing wave and without NS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;st-hl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /cast War Stomp&lt;br /&gt;
 /target Jindi&lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
Normally I just use this for war stomp, but if I want a big heal after that, just keep pressing...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;t-heal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
This is a big insta-heal with both trinkets&lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 13 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /use 14 &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Nature&amp;#039;s Swiftness &lt;br /&gt;
 /stopcasting &lt;br /&gt;
 /cast Healing Wave&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
A nice context-sensitive mount macro&lt;br /&gt;
 /cast [Stance:1] Ghost Wolf&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Nature&amp;#039;s Swiftness&lt;br /&gt;
 /stopcasting&lt;br /&gt;
 /use [flyable,nomounted] Blue Windrider&lt;br /&gt;
 /use [noflyable,nomounted,outdoors] Black War Kodo&lt;br /&gt;
 /cast [combat,nomounted,outdoors] Ghost Wolf&lt;br /&gt;
 /dismount&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Mac_OS_X_Server&amp;diff=1284</id>
		<title>Mac OS X Server</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Mac_OS_X_Server&amp;diff=1284"/>
				<updated>2008-08-04T18:23:15Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Disabling Automounts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Administration Tricks ==&lt;br /&gt;
You can closely examine some of the server manager data by making an https connection with your browser to an URL in the form:&lt;br /&gt;
&lt;br /&gt;
https://host:311/servermgr_info.html&lt;br /&gt;
&lt;br /&gt;
Authenticate as an admin.&lt;br /&gt;
&lt;br /&gt;
== Disabling Automounts ==&lt;br /&gt;
Add the following to /etc/auto_master&lt;br /&gt;
&lt;br /&gt;
 /Network/Servers	-null&lt;br /&gt;
 /Network/Applications	-null&lt;br /&gt;
 /Network/Library	-null&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Mac_OS_X_Server&amp;diff=1283</id>
		<title>Mac OS X Server</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Mac_OS_X_Server&amp;diff=1283"/>
				<updated>2008-08-04T18:22:49Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Disabling Automounts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Administration Tricks ==&lt;br /&gt;
You can closely examine some of the server manager data by making an https connection with your browser to an URL in the form:&lt;br /&gt;
&lt;br /&gt;
https://host:311/servermgr_info.html&lt;br /&gt;
&lt;br /&gt;
Authenticate as an admin.&lt;br /&gt;
&lt;br /&gt;
== Disabling Automounts ==&lt;br /&gt;
 /Network/Servers	-null&lt;br /&gt;
 /Network/Applications	-null&lt;br /&gt;
 /Network/Library	-null&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Mac_OS_X_Server&amp;diff=1282</id>
		<title>Mac OS X Server</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Mac_OS_X_Server&amp;diff=1282"/>
				<updated>2008-08-04T18:22:37Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Administration Tricks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Administration Tricks ==&lt;br /&gt;
You can closely examine some of the server manager data by making an https connection with your browser to an URL in the form:&lt;br /&gt;
&lt;br /&gt;
https://host:311/servermgr_info.html&lt;br /&gt;
&lt;br /&gt;
Authenticate as an admin.&lt;br /&gt;
&lt;br /&gt;
== Disabling Automounts ==&lt;br /&gt;
	/Network/Servers	-null&lt;br /&gt;
	/Network/Applications	-null&lt;br /&gt;
	/Network/Library	-null&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Apache&amp;diff=1281</id>
		<title>Apache</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Apache&amp;diff=1281"/>
				<updated>2008-07-15T18:52:19Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: added mysql auth bits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;start with apachectl startssl&lt;br /&gt;
&lt;br /&gt;
 o conf/ssl.key/ca.key&lt;br /&gt;
   The PEM-encoded RSA private key file of the CA which you can&lt;br /&gt;
   use to sign other servers or clients. KEEP THIS FILE PRIVATE!&lt;br /&gt;
 o conf/ssl.crt/ca.crt&lt;br /&gt;
   The PEM-encoded X.509 certificate file of the CA which you use to&lt;br /&gt;
   sign other servers or clients. When you sign clients with it (for&lt;br /&gt;
   SSL client authentication) you can configure this file with the&lt;br /&gt;
   &amp;#039;SSLCACertificateFile&amp;#039; directive.&lt;br /&gt;
 o conf/ssl.key/server.key&lt;br /&gt;
   The PEM-encoded RSA private key file of the server which you configure&lt;br /&gt;
   with the &amp;#039;SSLCertificateKeyFile&amp;#039; directive (automatically done&lt;br /&gt;
   when you install via APACI). KEEP THIS FILE PRIVATE!&lt;br /&gt;
 o conf/ssl.crt/server.crt&lt;br /&gt;
   The PEM-encoded X.509 certificate file of the server which you configure&lt;br /&gt;
   with the &amp;#039;SSLCertificateFile&amp;#039; directive (automatically done&lt;br /&gt;
   when you install via APACI).&lt;br /&gt;
 o conf/ssl.csr/server.csr&lt;br /&gt;
   The PEM-encoded X.509 certificate signing request of the server file which&lt;br /&gt;
   you can send to an official Certificate Authority (CA) in order&lt;br /&gt;
   to request a real server certificate (signed by this CA instead&lt;br /&gt;
   of our own CA) which later can replace the conf/ssl.crt/server.crt&lt;br /&gt;
   file.&lt;br /&gt;
&lt;br /&gt;
Some useful apache directives for tweaking the autoindex pages. Scalable column width and reverse sort by date.&lt;br /&gt;
&lt;br /&gt;
 IndexOptions NameWidth=*&lt;br /&gt;
 IndexOrderDefault Descending Date&lt;br /&gt;
&lt;br /&gt;
back to [[meta]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MYSQL Authentication Sample ==&lt;br /&gt;
Uses mod_auth_mysql:&lt;br /&gt;
&lt;br /&gt;
 AuthName &amp;#039;Administrator Login&amp;#039;&lt;br /&gt;
 AuthType basic&lt;br /&gt;
 AuthMySQLEnable On&lt;br /&gt;
 AuthMySQLHost sql.dubstep.fm&lt;br /&gt;
 AuthMySQLUser ****&lt;br /&gt;
 AuthMySQLPassword ****&lt;br /&gt;
 AuthMySQLDB dubstep_main&lt;br /&gt;
 AuthMySQLUserTable jos_users&lt;br /&gt;
 AuthMySQLNameField username&lt;br /&gt;
 AuthMySQLPasswordField password&lt;br /&gt;
 AuthMySQLGroupField gid&lt;br /&gt;
 AuthMySQLPwEncryption md5&lt;br /&gt;
 require group 25 31&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1280</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1280"/>
				<updated>2008-06-03T06:05:51Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos service principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The Kerberos v5 spec (rfc 1510) assumes and requires that the server name portion of a kerberos principal be just that: a server name (or address). To wit:&lt;br /&gt;
&amp;lt;pre&amp;gt;7.2.1. Name of server principals&lt;br /&gt;
&lt;br /&gt;
   The principal identifier for a server on a host will generally be&lt;br /&gt;
   composed of two parts: (1) the realm of the KDC with which the server&lt;br /&gt;
   is registered, and (2) a two-component name of type NT-SRV-HST if the&lt;br /&gt;
   host name is an Internet domain name or a multi-component name of&lt;br /&gt;
   type NT-SRV-XHST if the name of the host is of a form such as X.500&lt;br /&gt;
   that allows slash (/) separators.  The first component of the two- or&lt;br /&gt;
   multi-component name will identify the service and the latter&lt;br /&gt;
   components will identify the host.  Where the name of the host is not&lt;br /&gt;
   case sensitive (for example, with Internet domain names) the name of&lt;br /&gt;
   the host must be lower case.  For services such as telnet and the&lt;br /&gt;
   Berkeley R commands which run with system privileges, the first&lt;br /&gt;
   component will be the string &amp;quot;host&amp;quot; instead of a service specific&lt;br /&gt;
   identifier.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it is not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, AppleFileServer and smbd have their service principal names written into their respective configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;br /&gt;
&lt;br /&gt;
* http://www.gnu.org/software/shishi/manual/html_node/Realm-and-Principal-Naming.html Nice detail on realm and principal names from a Kerberos implementation called Shishi (complaint with the Kerberos v5 spec).&lt;br /&gt;
&lt;br /&gt;
* http://crpit.com/confpapers/CRPITV26Pirzada2.pdf Kerberos assisted Authentication in Mobile Ad-hoc Networks. Here is an example of a Kerberos implementation designed for ad-hoc networks. Strangely enough, this is not a fully peer-to-peer implementation, and requires the existence of authentication servers other than the one hosting the service you wish to use. It also seems quite a bit more complex than apple&amp;#039;s LKDC implementation.&lt;br /&gt;
&lt;br /&gt;
* http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.28.383 Distributed Authentication in Kerberos Using Public Key Cryptography. This document from 1997 describes how a PKI might be used to perform distributed authentication using Kerberos. This implementation eliminates the need for a centralized KDC (instead relying on a centralized certificate authority), although does not deal with dynamic peer discovery in an ad hoc networking context.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1279</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1279"/>
				<updated>2008-05-15T00:49:59Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Added quote of kerberos spec&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos service principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The Kerberos v5 spec (rfc 1510) assumes and requires that the server name portion of a kerberos principal be just that: a server name (or address). To wit:&lt;br /&gt;
&amp;lt;pre&amp;gt;7.2.1. Name of server principals&lt;br /&gt;
&lt;br /&gt;
   The principal identifier for a server on a host will generally be&lt;br /&gt;
   composed of two parts: (1) the realm of the KDC with which the server&lt;br /&gt;
   is registered, and (2) a two-component name of type NT-SRV-HST if the&lt;br /&gt;
   host name is an Internet domain name or a multi-component name of&lt;br /&gt;
   type NT-SRV-XHST if the name of the host is of a form such as X.500&lt;br /&gt;
   that allows slash (/) separators.  The first component of the two- or&lt;br /&gt;
   multi-component name will identify the service and the latter&lt;br /&gt;
   components will identify the host.  Where the name of the host is not&lt;br /&gt;
   case sensitive (for example, with Internet domain names) the name of&lt;br /&gt;
   the host must be lower case.  For services such as telnet and the&lt;br /&gt;
   Berkeley R commands which run with system privileges, the first&lt;br /&gt;
   component will be the string &amp;quot;host&amp;quot; instead of a service specific&lt;br /&gt;
   identifier.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, AppleFileServer and smbd have their service principal names written into their respective configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;br /&gt;
&lt;br /&gt;
* http://www.gnu.org/software/shishi/manual/html_node/Realm-and-Principal-Naming.html Nice detail on realm and principal names from a Kerberos implementation called Shishi (complaint with the Kerberos v5 spec).&lt;br /&gt;
&lt;br /&gt;
* http://crpit.com/confpapers/CRPITV26Pirzada2.pdf Kerberos assisted Authentication in Mobile Ad-hoc Networks. Here is an example of a Kerberos implementation designed for ad-hoc networks. Strangely enough, this is not a fully peer-to-peer implementation, and requires the existence of authentication servers other than the one hosting the service you wish to use. It also seems quite a bit more complex than apple&amp;#039;s LKDC implementation.&lt;br /&gt;
&lt;br /&gt;
* http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.28.383 Distributed Authentication in Kerberos Using Public Key Cryptography. This document from 1997 describes how a PKI might be used to perform distributed authentication using Kerberos. This implementation eliminates the need for a centralized KDC (instead relying on a centralized certificate authority), although does not deal with dynamic peer discovery in an ad hoc networking context.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1278</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1278"/>
				<updated>2008-05-14T00:20:43Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Added link to Distributed Authentication in Kerberos Using Public Key Cryptography&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, AppleFileServer and smbd have their service principal names written into their respective configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;br /&gt;
&lt;br /&gt;
* http://www.gnu.org/software/shishi/manual/html_node/Realm-and-Principal-Naming.html Nice detail on realm and principal names from a Kerberos implementation called Shishi (complaint with the Kerberos v5 spec).&lt;br /&gt;
&lt;br /&gt;
* http://crpit.com/confpapers/CRPITV26Pirzada2.pdf Kerberos assisted Authentication in Mobile Ad-hoc Networks. Here is an example of a Kerberos implementation designed for ad-hoc networks. Strangely enough, this is not a fully peer-to-peer implementation, and requires the existence of authentication servers other than the one hosting the service you wish to use. It also seems quite a bit more complex than apple&amp;#039;s LKDC implementation.&lt;br /&gt;
&lt;br /&gt;
* http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.28.383 Distributed Authentication in Kerberos Using Public Key Cryptography. This document from 1997 describes how a PKI might be used to perform distributed authentication using Kerberos. This implementation eliminates the need for a centralized KDC (instead relying on a centralized certificate authority), although does not deal with dynamic peer discovery in an ad hoc networking context.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1277</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1277"/>
				<updated>2008-05-14T00:00:08Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Moved link from ACM to crpit.org&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, AppleFileServer and smbd have their service principal names written into their respective configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;br /&gt;
&lt;br /&gt;
* http://www.gnu.org/software/shishi/manual/html_node/Realm-and-Principal-Naming.html Nice detail on realm and principal names from a Kerberos implementation called Shishi (complaint with the Kerberos v5 spec).&lt;br /&gt;
&lt;br /&gt;
* http://crpit.com/confpapers/CRPITV26Pirzada2.pdf Kerberos assisted Authentication in Mobile Ad-hoc Networks. Here is an example of a Kerberos implementation designed for ad-hoc networks. Strangely enough, this is not a fully peer-to-peer implementation, and requires the existence of authentication servers other than the one hosting the service you wish to use. It also seems quite a bit more complex than apple&amp;#039;s LKDC implementation.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1276</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1276"/>
				<updated>2008-05-13T23:57:35Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Added link to ACM&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, AppleFileServer and smbd have their service principal names written into their respective configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;br /&gt;
&lt;br /&gt;
* http://www.gnu.org/software/shishi/manual/html_node/Realm-and-Principal-Naming.html Nice detail on realm and principal names from a Kerberos implementation called Shishi (complaint with the Kerberos v5 spec).&lt;br /&gt;
&lt;br /&gt;
* http://portal.acm.org/citation.cfm?id=979922.979928&amp;amp;coll=portal&amp;amp;dl=ACM Kerberos assisted Authentication in Mobile Ad-hoc Networks (requires a free account to view the full text). Here is an example of a Kerberos implementation designed for ad-hoc networks. Strangely enough, this is not a fully peer-to-peer implementation, and requires the existence of authentication servers other than the one hosting the service you wish to use. It also seems quite a bit more complex than apple&amp;#039;s LKDC implementation.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1275</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1275"/>
				<updated>2008-05-13T23:46:32Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Added link to shishi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, AppleFileServer and smbd have their service principal names written into their respective configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;br /&gt;
&lt;br /&gt;
* http://www.gnu.org/software/shishi/manual/html_node/Realm-and-Principal-Naming.html Nice detail on realm and principal names from a Kerberos implementation called Shishi (complaint with the Kerberos v5 spec).&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1274</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1274"/>
				<updated>2008-05-13T21:52:04Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Harnessing Authentication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, AppleFileServer and smbd have their service principal names written into their respective configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1273</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1273"/>
				<updated>2008-05-13T21:50:37Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Harnessing Authentication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of a service principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos service principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it running whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
On the service configuration end, afp and cifs have their service principal names written into their configuration files, while the vnc service does not (VNCPrivilegeProxy?).&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1272</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1272"/>
				<updated>2008-05-13T21:35:09Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Advertising and Discovering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use (regular ol&amp;#039; unicast) DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1271</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1271"/>
				<updated>2008-05-13T21:33:44Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Advertising and Discovering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1270</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1270"/>
				<updated>2008-05-13T21:33:01Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Standard Deviation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks (via the private KerberosHelper framework). It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1269</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1269"/>
				<updated>2008-05-13T21:25:45Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Harnessing Authentication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks. It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard methods for constructing the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1268</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1268"/>
				<updated>2008-05-13T20:55:25Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Standard Deviation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. The discovery portion of the LKDC implementation only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks. It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1267</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1267"/>
				<updated>2008-05-13T20:45:23Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: Added kinit user@LKDC example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address). Also unlike most Kerberos deployments, the clients are not expected to maintain hard-coded references to other LKDCs, or any Kerberos client configuration at all for that matter (although it does continue to work if you have existing configuration).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this. It is important to note that all of the secure aspects of the authentication are performed in the standard Kerberos manner. The discovery and harness acts as a thin wrapper that only barely extends into the Kerberos layer. How far does it extend? Consider the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;{15} andre@donk [~] % klist&lt;br /&gt;
klist: No Kerberos 5 tickets in credentials cache&lt;br /&gt;
{16} andre@donk [~] % cat /Library/Preferences/edu.mit.Kerberos&lt;br /&gt;
cat: /Library/Preferences/edu.mit.Kerberos: No such file or directory&lt;br /&gt;
{17} andre@donk [~] % cat /etc/krb5.conf&lt;br /&gt;
cat: /etc/krb5.conf: No such file or directory&lt;br /&gt;
{18} andre@donk [~] % kinit andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
Please enter the password for andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B: &lt;br /&gt;
{19} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 13:32:39  05/13/08 23:32:37  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The take-home point here is that as long as you know the realm / principal name, it&amp;#039;s business as usual. The &amp;quot;look up KDC for realm&amp;quot; and &amp;quot;look up realm for KDC&amp;quot; functionality is integrated into the system&amp;#039;s kerberos frameworks.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1266</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1266"/>
				<updated>2008-05-13T19:45:17Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* configureLocalKDC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and their corresponding keytabs, edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1265</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1265"/>
				<updated>2008-05-13T12:36:53Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* configureLocalKDC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (using kdcsetup, which also creates the directory services record), creates service principals and edits service config files for supported services, and installs a kerberos certificate into the system keychain. This is a pretty nice script, and is certainly worth a look. To give you an idea, consider the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        my %afp_config = (service =&amp;gt; &amp;#039;afpserver&amp;#039;, realm =&amp;gt; $LKDC_realm,&lt;br /&gt;
                          prefs =&amp;gt; &amp;#039;/Library/Preferences/com.apple.AppleFileServer&amp;#039;,&lt;br /&gt;
                          key =&amp;gt; &amp;#039;kerberosPrincipal&amp;#039;, format =&amp;gt; &amp;#039;%s/%s@%2$s&amp;#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1264</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1264"/>
				<updated>2008-05-13T12:13:52Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
====NetAuthAgent====&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCLocate====&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====KerberosHelper====&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====LKDCHelper====&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====configureLocalKDC====&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (with kdcsetup), creates service principals and edits service config files for supported services, and installs a kerberos certificate into the system keychain.&lt;br /&gt;
&lt;br /&gt;
==== VNCPrivilegeProxy====&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1263</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1263"/>
				<updated>2008-05-13T12:11:56Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
===NetAuthAgent===&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCLocate===&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===KerberosHelper===&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCHelper===&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==configureLocalKDC==&lt;br /&gt;
/usr/libexec/configureLocalKDC is a perl script that creates the LKDC at installation time (with kdcsetup), creates service principals and edits service config files for supported services, and installs a kerberos certificate into the system keychain.&lt;br /&gt;
&lt;br /&gt;
== VNCPrivilegeProxy==&lt;br /&gt;
/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy - unsure exactly what this does.&lt;br /&gt;
&amp;lt;pre&amp;gt;{9} root@donk [Default/config] # strings /System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Support/VNCPrivilegeProxy&lt;br /&gt;
__dyld_make_delayed_module_initializer_calls&lt;br /&gt;
__dyld_mod_term_funcs&lt;br /&gt;
Starting Privilege Proxy&lt;br /&gt;
com.apple.RemoteDesktop.PrivilegeProxy&lt;br /&gt;
&amp;#039;%s&amp;#039; server already starting&lt;br /&gt;
bootstrap_check_in bootstrap_create_service() failed: status=%d&lt;br /&gt;
&amp;#039;%s&amp;#039; server already active&lt;br /&gt;
server_init bootstrap_check_in() failed: status=%d&lt;br /&gt;
server_init bootstrap_unprivileged() failed: status=%d&lt;br /&gt;
server_init task_set_bootstrap_port(): %s&lt;br /&gt;
mach_msg_server:&lt;br /&gt;
/Library/Preferences/com.apple.VNCSettings.txt&lt;br /&gt;
&amp;#039;2, /+0&amp;amp;7!4-)1#&lt;br /&gt;
80( &lt;br /&gt;
91)!&lt;br /&gt;
:2*&amp;quot;&lt;br /&gt;
;3+#&amp;gt;6.&amp;amp;&lt;br /&gt;
=5-%&lt;br /&gt;
&amp;lt;4,$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1262</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1262"/>
				<updated>2008-05-13T12:05:48Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* LKDCHelper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
===NetAuthAgent===&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCLocate===&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===KerberosHelper===&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCHelper===&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* /usr/libexec/configureLocalKDC - this is a perl script that creates the LKDC at installation time (with kdcsetup), including creating service principals, editing service config files, and installing a kerberos certificate into the system keychain.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1261</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1261"/>
				<updated>2008-05-13T12:00:59Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
Apple has overcome both of these challenges rather well, although the vast majority of the LKDC implementation should be considered &amp;#039;private&amp;#039; - don&amp;#039;t go building apps around this.&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
===NetAuthAgent===&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCLocate===&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===KerberosHelper===&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCHelper===&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* /usr/libexec/configureLocalKDC - this is a perl script that creates the LKDC at installation time, including creating service principals, editing service config files, and installing a kerberos certificate into the system keychain.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1260</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1260"/>
				<updated>2008-05-13T11:57:37Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Using KerberosHelper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf!)&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
===NetAuthAgent===&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCLocate===&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===KerberosHelper===&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCHelper===&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* /usr/libexec/configureLocalKDC - this is a perl script that creates the LKDC at installation time, including creating service principals, editing service config files, and installing a kerberos certificate into the system keychain.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1259</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1259"/>
				<updated>2008-05-13T11:56:50Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Advertising and Discovering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each Mac OS X system advertises its own LKDC. At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf)!&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
===NetAuthAgent===&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCLocate===&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===KerberosHelper===&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCHelper===&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* /usr/libexec/configureLocalKDC - this is a perl script that creates the LKDC at installation time, including creating service principals, editing service config files, and installing a kerberos certificate into the system keychain.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1258</id>
		<title>LKDC</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=LKDC&amp;diff=1258"/>
				<updated>2008-05-13T11:49:18Z</updated>
		
		<summary type="html">&lt;p&gt;Dre: /* Harnessing Authentication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The local KDC in Leopard is pretty rad. In the absence of any real documentation, this page exists as a jumble of observations and theories.&lt;br /&gt;
&lt;br /&gt;
==Positioning and Use in Leoaprd==&lt;br /&gt;
The Local KDC (LKDC) is a Kerberos implementation that extends &amp;quot;single sign-on&amp;quot; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup... you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{3} andre@donk [~] % sudo klist -k &lt;br /&gt;
Keytab name: FILE:/etc/krb5.keytab&lt;br /&gt;
KVNO Principal&lt;br /&gt;
---- --------------------------------------------------------------------------&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
   3 vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{10} andre@donk [~] % sudo kadmin.local -q listprincs&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
K/M@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
afpserver/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
cifs/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/changepw@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/donk.local@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
kadmin/history@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
krbtgt/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
vnc/LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{13} andre@donk [~] % sudo kadmin.local -q &amp;#039;get_principal andre&amp;#039;&lt;br /&gt;
Authenticating as principal andre/admin@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B with password.&lt;br /&gt;
Principal: andre@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Expiration date: [never]&lt;br /&gt;
Last password change: Sat May 10 21:43:57 PDT 2008&lt;br /&gt;
Password expiration date: [none]&lt;br /&gt;
Maximum ticket life: 0 days 10:00:00&lt;br /&gt;
Maximum renewable life: 7 days 00:00:00&lt;br /&gt;
Last modified: Sat May 10 21:43:57 PDT 2008 (root/admin@LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD)&lt;br /&gt;
Last successful authentication: [never]&lt;br /&gt;
Last failed authentication: [never]&lt;br /&gt;
Failed password attempts: 0&lt;br /&gt;
Number of keys: 4&lt;br /&gt;
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt&lt;br /&gt;
Key: vno 1, ArcFour with HMAC/md5, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, no salt&lt;br /&gt;
Key: vno 1, DES cbc mode with CRC-32, Version 4&lt;br /&gt;
Attributes: REQUIRES_PRE_AUTH&lt;br /&gt;
Policy: [none]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{106} andre@donk [~] % klist&lt;br /&gt;
Kerberos 5 ticket cache: &amp;#039;API:Initial default ccache&amp;#039;&lt;br /&gt;
Default principal: andre@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
&lt;br /&gt;
Valid Starting     Expires            Service Principal&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  krbtgt/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&lt;br /&gt;
05/13/08 00:35:00  05/13/08 10:34:58  vnc/LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B@LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
	renew until 05/20/08 00:34:58&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard Deviation==&lt;br /&gt;
The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).&lt;br /&gt;
&lt;br /&gt;
This presents two primary challenges:&lt;br /&gt;
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context&lt;br /&gt;
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos&lt;br /&gt;
&lt;br /&gt;
==Advertising and Discovering==&lt;br /&gt;
Not surprisingly, the mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name. From the krb5.conf man page [libdefaults] section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       dns_lookup_kdc&lt;br /&gt;
              Indicate whether DNS SRV records shoud be used to locate the KDCs and&lt;br /&gt;
              other  servers for a realm, if they are not listed in the information&lt;br /&gt;
              for the realm.  The default is to use these records.&lt;br /&gt;
&lt;br /&gt;
       dns_lookup_realm&lt;br /&gt;
              Indicate whether DNS TXT records should be used to determine the Ker-&lt;br /&gt;
              beros realm of a host.  The default is not to use these records.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At some point during or after startup, the LKDC realm name is read from Directory Services, e.g.&lt;br /&gt;
 dscl . -read /Config/KerberosKDC RealName&lt;br /&gt;
The LKDC realm name is then advertised in the txt portion of a multicast DNS record called _kerberos in the .local name space. This record may be manually queried as follows:&lt;br /&gt;
&lt;br /&gt;
 dns-sd -Q &amp;quot;_kerberos.donk.local&amp;quot; txt&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;donk&amp;quot; with the bonjour name of a Leopard machine on your local network (can test on yourself if needed).&lt;br /&gt;
&lt;br /&gt;
The result is a string of hex characters. This command does not terminate, so control-C to stop it. Now take the hex and run it through xxd -r -c 256.&lt;br /&gt;
&lt;br /&gt;
 xxd -r -c 256&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paste in the hex string, press return&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is the LKDC realm name, such as LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
&lt;br /&gt;
==Harnessing Authentication==&lt;br /&gt;
The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&amp;#039;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.&lt;br /&gt;
&lt;br /&gt;
The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&amp;#039;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.&lt;br /&gt;
&lt;br /&gt;
Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.&lt;br /&gt;
&lt;br /&gt;
==Using KerberosHelper==&lt;br /&gt;
Some of the basic methods provided by KerberosHelper might be exercised as follows (big ups to landonf)!&lt;br /&gt;
&lt;br /&gt;
krb.c contains the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
extern int LKDCGetLocalRealm(char **realm);&lt;br /&gt;
extern int LKDCDiscoverRealm(const char *host, char **realm);&lt;br /&gt;
&lt;br /&gt;
// XXX arg1 - 1 seems to trigger the dump to syslog.&lt;br /&gt;
extern int LKDCDumpStatus(int32_t arg1);&lt;br /&gt;
&lt;br /&gt;
void find_realm (const char *host) {&lt;br /&gt;
    char *realm;&lt;br /&gt;
    char *kdc;&lt;br /&gt;
    uint32_t arg3;&lt;br /&gt;
&lt;br /&gt;
    /* Find the realm */&lt;br /&gt;
    if (LKDCDiscoverRealm(host, &amp;amp;realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Disovered Realm (%s): %s\n&amp;quot;, host, realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(realm);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    char *local_realm;&lt;br /&gt;
&lt;br /&gt;
    if (LKDCGetLocalRealm(&amp;amp;local_realm) == 0) {&lt;br /&gt;
        printf(&amp;quot;Local Realm: %s\n&amp;quot;, local_realm);&lt;br /&gt;
        free(local_realm);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Dump to syslog. XXX argument &amp;#039;1&amp;#039; is a guess */&lt;br /&gt;
    LKDCDumpStatus(1);&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        printf(&amp;quot;Usage: %s &amp;lt;hostname&amp;gt;\n&amp;quot;, argv[0]);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    find_realm(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile with:&lt;br /&gt;
&lt;br /&gt;
 gcc krb.c -o krb -F/System/Library/PrivateFrameworks -framework KerberosHelper&lt;br /&gt;
&lt;br /&gt;
Run it with one argument: a bonjour name of a leopard machine on your network. e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;{33} andre@donk [work/krb] % ./krb dude.local&lt;br /&gt;
Local Realm: LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
Disovered Realm (dude.local): LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, check your system.log. LKDCDumpStatus produces something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: Cache root node = 0x1034f0&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x1034f0 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x1059d0) LKDC:SHA1.8B0FBACC08E3152A473A68D303E297A13CAA3AFD&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x104d50) donk.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus: node = 0x106030 {&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  realmName   = (0x106460) LKDC:SHA1.C81B8D1A890D4D4DD079059A54594AA53B9A1A2B&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  serviceHost = (0x105fd0) dude.local&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  servicePort = 88&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                  TTL         = 7200&lt;br /&gt;
May 13 02:38:56 donk LKDCHelper[30484]:     LKDCDumpCacheStatus:                 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interesting Files==&lt;br /&gt;
===NetAuthAgent===&lt;br /&gt;
This appears to be a service client helper that manages the authentication process at a high level on behalf of various clients included with Mac OS X. A string dump reveals the following chunk of kerberos service names:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver&lt;br /&gt;
webdaveserver&lt;br /&gt;
ftpsserver&lt;br /&gt;
ftpserver&lt;br /&gt;
cifs&lt;br /&gt;
afpserver&amp;lt;/pre&amp;gt;&lt;br /&gt;
vncserver, cifs, and afpserver are the only 3 services that are kerberized in the LKDC by default, though NetAuthAgent appears to support others as well. Looking at all strings matching &amp;#039;kerb&amp;#039;, we see:&lt;br /&gt;
&amp;lt;pre&amp;gt;{5} andre@donk [~] % strings /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | grep -i kerb  &lt;br /&gt;
KerberosSession&lt;br /&gt;
BypassKerberos&lt;br /&gt;
kerberosClientPrincipalCredentials&lt;br /&gt;
kerberosRelease&lt;br /&gt;
kerberosClientPrincipal&lt;br /&gt;
kerberosKeychainRealm&lt;br /&gt;
kerberosPrincipalInfo&lt;br /&gt;
MountedByKerberos&lt;br /&gt;
SupportsKerberos&lt;br /&gt;
/System/Library/CoreServices/Kerberos.app&lt;br /&gt;
mInvalidKerberosUserName&lt;br /&gt;
checkForKerberosUserName:&lt;br /&gt;
isValidKerberosUserName:&lt;br /&gt;
useKerberos&lt;br /&gt;
kerberosServiceName&lt;br /&gt;
kerberosServicePrincipalHint&lt;br /&gt;
kerberosSession&lt;br /&gt;
kerberosServicePrincipal&lt;br /&gt;
kerberosAcquireTicket&lt;br /&gt;
Kerberos&lt;br /&gt;
AllowKerberosUI&lt;br /&gt;
KerberosInfo&lt;br /&gt;
kerberosUIOption&lt;br /&gt;
kerberosHostDisplayName&lt;br /&gt;
kerberosHostAddress&lt;br /&gt;
kerberosAlreadyHasTicket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent:&lt;br /&gt;
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&lt;br /&gt;
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetAuthAgent.app also includes NetAuthSysAgent, which appears to be a variant of NetAuthAgent for handling system-level operations that do not require user interface. It contains lots of filesystem semantics, and also appears to deal with certificates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{108} andre@donk [~] % otool -L /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent | cut -d &amp;#039; &amp;#039; -f1&lt;br /&gt;
/System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent:&lt;br /&gt;
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation&lt;br /&gt;
	/System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount&lt;br /&gt;
	/System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper&lt;br /&gt;
	/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface&lt;br /&gt;
	/System/Library/Frameworks/Security.framework/Versions/A/Security&lt;br /&gt;
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib&lt;br /&gt;
	/usr/lib/libSystem.B.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices&lt;br /&gt;
	/usr/lib/libobjc.A.dylib&lt;br /&gt;
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCLocate===&lt;br /&gt;
This (non-private?) Kerberos framework plugin looks like it&amp;#039;s able to perform DNS queries to retrieve LKDC info. It also seems to interact with a mach service created by LKDCHelper called com.apple.KerberosHelper.LKDCHelper.&lt;br /&gt;
&amp;lt;pre&amp;gt;{14} andre@donk [~] % strings /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate       &lt;br /&gt;
%s: &lt;br /&gt;
LKDCLookup&lt;br /&gt;
Declined to handle address family %d&lt;br /&gt;
svc = %d, realm = %s, family= %d, socktype = %d&lt;br /&gt;
KDC|MasterKDC&lt;br /&gt;
LKDC:&lt;br /&gt;
getaddrinfo () == %d&lt;br /&gt;
0x%08p: family = %d, socktype = %d, protocol = %d&lt;br /&gt;
Running callback 0x%08p&lt;br /&gt;
Unexpected address family %d&lt;br /&gt;
Callback done 0x%08p, err=%d&lt;br /&gt;
inet_ntop failed: %s&lt;br /&gt;
addr = %s, port = %d&lt;br /&gt;
failed %d&lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
[...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{112} andre@donk [~] % otool -L /System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate          &lt;br /&gt;
/System/Library/KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle/Contents/MacOS/LKDCLocate:&lt;br /&gt;
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)&lt;br /&gt;
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===KerberosHelper===&lt;br /&gt;
This private framework appears to provide API that can be used on behalf of service clients (or their agents) to discover the LKDC information of a remote realm.&lt;br /&gt;
&amp;lt;pre&amp;gt;{6} root@donk [~] # strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/KerberosHelper &lt;br /&gt;
LKDCGetHelperPort&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
%s: cannot contact helper&lt;br /&gt;
LKDCHelperExit&lt;br /&gt;
Mach communication failed: %s&lt;br /&gt;
LKDCDumpStatus&lt;br /&gt;
LKDCSetLogLevel&lt;br /&gt;
LKDCGetLocalRealm&lt;br /&gt;
[[[ %s&lt;br /&gt;
Local realm = %s&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCDiscoverRealm&lt;br /&gt;
No place to store discovered realm.&lt;br /&gt;
realm = %s&lt;br /&gt;
LKDCFindKDCForRealm&lt;br /&gt;
No place to store discovered KDC hostname.&lt;br /&gt;
KDC Hostname = %s:%u&lt;br /&gt;
LKDC:&lt;br /&gt;
    %s: krb5 call got %d (%s) on %s:%d&lt;br /&gt;
realm_for_host&lt;br /&gt;
(null)&lt;br /&gt;
[[[ %s: hostname=%s hintrealm=%s&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/KerberosHelper.c&lt;br /&gt;
    %s: krb5_get_host_realm success&lt;br /&gt;
    %s: krb5_get_host_realm returned unusable realm!&lt;br /&gt;
    %s: LKDCDiscoverRealm success&lt;br /&gt;
]]] %s: returning realm=%s&lt;br /&gt;
]]] %s: failed to determine realm&lt;br /&gt;
[[[ KRBCopyRealm () - required parameters okay&lt;br /&gt;
]]] KRBCopyRealm () = %d&lt;br /&gt;
[[[ KRBCopyKeychainLookupInfo () - required parameters okay&lt;br /&gt;
Username&lt;br /&gt;
KeychainAccountName&lt;br /&gt;
DisableSaveToKeychain&lt;br /&gt;
edu.mit.Kerberos.KerberosAgent&lt;br /&gt;
SavePasswordDisabled&lt;br /&gt;
    KRBCopyKeychainLookupInfo: DisableSaveToKeychainKey = TRUE&lt;br /&gt;
    KRBCopyKeychainLookupInfo: CFPreferencesCopyAppValue == NULL&lt;br /&gt;
]]] KRBCopyKeychainLookupInfo () = %d&lt;br /&gt;
[[[ KRBCopyServicePrincipal () - required parameters okay&lt;br /&gt;
    KRBCopyServicePrincipal: svcName mismatch inService = &amp;quot;%s&amp;quot;, svcName = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useName = &amp;quot;%s&amp;quot;&lt;br /&gt;
LKDC:&lt;br /&gt;
    KRBCopyServicePrincipal: realm is Local KDC.&lt;br /&gt;
    KRBCopyServicePrincipal: Bad inHostName, using svcInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: useInstance = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyServicePrincipal: Fatal - Bad inHostName &amp;amp; no inAdvertisedPrincipal&lt;br /&gt;
%s/%s@%s&lt;br /&gt;
    KRBCopyServicePrincipal: principal = &amp;quot;%s/%s@%s&amp;quot;&lt;br /&gt;
]]] KRBCopyServicePrincipal () = %d&lt;br /&gt;
KRBCopyClientPrincipalInfo&lt;br /&gt;
[[[ KRBCopyClientPrincipalInfo () - required parameters okay&lt;br /&gt;
Certificate&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate information in dictionary&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Certificate not present in dictionary&lt;br /&gt;
.Mac Sharing Certificate&lt;br /&gt;
%@@%@&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Using login name = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: principal guess = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: ccache principal match = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: found a single ticket for realm, replacing principal &amp;amp; username&lt;br /&gt;
    KRBCopyClientPrincipalInfo: Setting found Username to = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBCopyClientPrincipalInfo: using principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
ClientPrincipal&lt;br /&gt;
    KRBCopyClientPrincipalInfo: usingCertificate == %d&lt;br /&gt;
UsingCertificate&lt;br /&gt;
CetificateHash&lt;br /&gt;
CertificateInferredLabel&lt;br /&gt;
    KRBCopyClientPrincipalInfo: InferredLabel = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBCopyClientPrincipalInfo () = %d&lt;br /&gt;
%@@%s&lt;br /&gt;
[[[ KRBTestForExistingTicket () - required parameters okay&lt;br /&gt;
    KRBTestForExistingTicket: principal = &amp;quot;%s&amp;quot;&lt;br /&gt;
    KRBTestForExistingTicket: Valid Ticket, ccacheName = &amp;quot;%s&amp;quot;&lt;br /&gt;
]]] KRBTestForExistingTicket () = %d&lt;br /&gt;
KRBAcquireTicket&lt;br /&gt;
[[[ KRBAcquireTicket () - required parameters okay&lt;br /&gt;
    KRBAcquireTicket: Using a certificate&lt;br /&gt;
Password&lt;br /&gt;
]]] KRBAcquireTicket () = %d&lt;br /&gt;
[[[ KRBCloseSession () - required parameters okay&lt;br /&gt;
]]] KRBCloseSession () = %d&lt;br /&gt;
parse_principal_name&lt;br /&gt;
KRBCreateSession&lt;br /&gt;
[[[ %s () - required parameters okay&lt;br /&gt;
    %s: LocalKDC realm lookup only&lt;br /&gt;
    %s: __KRBCreateUTF8StringFromCFString failed&lt;br /&gt;
[[[ %s () decomposing %s&lt;br /&gt;
]]] %s () - %d&lt;br /&gt;
    %s: processed host name = %s&lt;br /&gt;
%s.local&lt;br /&gt;
    %s: last char of host name = 0x%02x&lt;br /&gt;
success&lt;br /&gt;
    %s: getaddrinfo = %s (%d)&lt;br /&gt;
    %s: canonical host name = %s&lt;br /&gt;
    %s: secondary match = %s&lt;br /&gt;
    %s: primary match = %s&lt;br /&gt;
    %s: could not find a suitable host/realm mapping&lt;br /&gt;
    %s: Using host name = %s, realm = %s&lt;br /&gt;
]]] %s () = %d&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LKDCHelper===&lt;br /&gt;
This executable is part of the KerberosHelper framework and is a launch agent that runs in the user&amp;#039;s namespace. This appears to fire up a mach service called com.apple.KerberosHelper.LKDCHelper that is used for IPC with other interested parties (see: elsewhere on this page).&lt;br /&gt;
&amp;lt;pre&amp;gt;{34} andre@donk [~] % strings /System/Library/PrivateFrameworks/KerberosHelper.framework/Versions/A/Resources/LKDCHelper&lt;br /&gt;
Idle exit&lt;br /&gt;
do_LKDCDumpStatus&lt;br /&gt;
[[[ %s&lt;br /&gt;
do_LKDCSetLogLevel&lt;br /&gt;
do_LKDCGetLocalRealm&lt;br /&gt;
Cached lookup&lt;br /&gt;
LocalKDCRealm = %s&lt;br /&gt;
do_LKDCDiscoverRealm&lt;br /&gt;
Looking up realm for %s&lt;br /&gt;
do_LKDCFindKDCForRealm&lt;br /&gt;
Looking up host for %s&lt;br /&gt;
%s: &lt;br /&gt;
Unauthorized access by euid=%lu pid=%lu&lt;br /&gt;
update_idle_timer&lt;br /&gt;
0 == gettimeofday(&amp;amp;last_message, NULL)&lt;br /&gt;
/SourceCache/KerberosHelper/KerberosHelper-31/Source/LKDCHelper-main.c&lt;br /&gt;
idletimer_main&lt;br /&gt;
0 == gettimeofday(&amp;amp;now, NULL)&lt;br /&gt;
Invalid idle timeout: %s&lt;br /&gt;
Usage: [-d] [-t maxidle]&lt;br /&gt;
Could not initialize ASL logging.&lt;br /&gt;
Starting (uid=%ul)&lt;br /&gt;
mach_port_allocate: %s&lt;br /&gt;
mach_port_insert_right: %s&lt;br /&gt;
com.apple.KerberosHelper.LKDCHelper&lt;br /&gt;
bootstrap_register2 failed: %s&lt;br /&gt;
CheckIn&lt;br /&gt;
Could not create checkin message for launchd.&lt;br /&gt;
Could not message launchd.&lt;br /&gt;
Launchd checkin failed: %s.&lt;br /&gt;
MachServices&lt;br /&gt;
Launchd reply does not contain %s dictionary.&lt;br /&gt;
Launchd reply does not contain %s Mach port.&lt;br /&gt;
Launchd gave me a null Mach port.&lt;br /&gt;
Failed to start idletimer thread: %s&lt;br /&gt;
mach_msg_server: %s&lt;br /&gt;
KerberosKDC&lt;br /&gt;
dsRecTypeStandard:Config&lt;br /&gt;
realname&lt;br /&gt;
_kerberos&lt;br /&gt;
LookupRealmCallBack&lt;br /&gt;
mDNSError = %d&lt;br /&gt;
More than one record, last one wins!!!&lt;br /&gt;
LKDCAddLocatorDetails&lt;br /&gt;
New entry for (realm=%s host=%s)&lt;br /&gt;
Replacing existing entry (realm=%s host=%s) with (realm=%s host=%s)&lt;br /&gt;
]]] %s = %d (%s)&lt;br /&gt;
LKDCHostnameForRealm&lt;br /&gt;
Cache hit&lt;br /&gt;
Cache miss&lt;br /&gt;
HandleEvents&lt;br /&gt;
LKDCLookupRealm&lt;br /&gt;
LKDCRealmForHostname&lt;br /&gt;
%s.%s&lt;br /&gt;
mDNSResult&lt;br /&gt;
CallbackError = %d&lt;br /&gt;
Timeout!&lt;br /&gt;
LKDCDumpCacheStatus&lt;br /&gt;
Cache root node = %08p&lt;br /&gt;
node = %08p {&lt;br /&gt;
                 realmName   = (%08p) %s&lt;br /&gt;
                 serviceHost = (%08p) %s&lt;br /&gt;
                 servicePort = %u&lt;br /&gt;
                 TTL         = %u&lt;br /&gt;
                }&lt;br /&gt;
Communication to the helper failed&lt;br /&gt;
Not authorized&lt;br /&gt;
Input parameter error&lt;br /&gt;
Serializing object failed&lt;br /&gt;
Unserializing object failed&lt;br /&gt;
Object passed is not a dictionary&lt;br /&gt;
A Local KDC was not found&lt;br /&gt;
Lookup of the KDC for the requested realm failed&lt;br /&gt;
    %s: &lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;unknown error&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* /usr/libexec/configureLocalKDC - this is a perl script that creates the LKDC at installation time, including creating service principals, editing service config files, and installing a kerberos certificate into the system keychain.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* http://www.felipe-alfaro.org/blog/2007/12/07/kerberizing-leopards-ssh/ This documents how to kerberize ssh / sshd, in Leopard, but uses a static configuration instead of dynamically discovering the remote realm name, as is done by the services kerberized in the LKDC by default.&lt;br /&gt;
&lt;br /&gt;
* http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html Exploring Leopard with DTrace - was useful in determining how some of the service clients interact with Kerberos.&lt;br /&gt;
&lt;br /&gt;
* http://developer.apple.com/technotes/tn2005/tn2083.html Daemons and Agents. Fantastic technote by Quinn. This helped me understand a bit more about the mach service that is provided by LKDCHelper.&lt;br /&gt;
&lt;br /&gt;
* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129443 Multicast DNS libraries for Ruby&lt;br /&gt;
&lt;br /&gt;
* http://www.ldap.com/1/commentary/wahl/20070511_01.shtml Discovering local identity services. Outlines several methods for dynamic discovery of how to bootstrap authentication sessions with a remote system.&lt;br /&gt;
&lt;br /&gt;
* http://www.cybersafe.ltd.uk/docs_standards/draft-ietf-krb-wg-krb-dns-locate-03.txt This expired draft documents how kerberos realm information might be discovered using dns.&lt;br /&gt;
&lt;br /&gt;
* http://www.dns-sd.org/ServiceTypes.html multicast DNS service types&lt;br /&gt;
&lt;br /&gt;
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt This expired draft documents multicast DNS in general&lt;br /&gt;
&lt;br /&gt;
* http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.6/doc/install.html#SEC9 Kerberos install document; this section documents how Kerberos finds realm information.&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	</feed>