<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>SshKerberosMac</title><revhistory><revision><revnumber>5</revnumber><date>2014-04-30 06:14:32</date><authorinitials>netj</authorinitials><revremark>Ticket Viewer app</revremark></revision><revision><revnumber>4</revnumber><date>2013-02-22 00:49:17</date><authorinitials>netj</authorinitials><revremark>Changed to madmax* since there will be a few of madmax-class machines :)</revremark></revision><revision><revnumber>3</revnumber><date>2012-11-23 05:36:00</date><authorinitials>netj</authorinitials><revremark>Updated hosts to include all servers</revremark></revision><revision><revnumber>2</revnumber><date>2012-09-28 03:56:58</date><authorinitials>netj</authorinitials><revremark>simply &quot;Mac&quot; is clear over &quot;Mac OS X&quot; (old) vs. &quot;OS X&quot; (new)</revremark></revision><revision><revnumber>1</revnumber><date>2012-09-28 03:54:11</date><authorinitials>netj</authorinitials><revremark>First draft</revremark></revision></revhistory></articleinfo><section><title>Using SSH with Kerberos from Mac</title><section><title>Configure Kerberos</title><para>The <ulink url="https://itservices.stanford.edu/service/ess/mac/kfm">Kerberos Configuration Tool (KCT) app</ulink> provided by Stanford's IT Services will prepare your Mac to work with <code>@CS.STANFORD.EDU</code> realm as well as many others, e.g., the default <code>@stanford.edu</code>. </para><para>If you use the <code>@CS.STANFORD.EDU</code> realm most of the time, you might want to change the default realm in <code>/Library/Preferences/edu.mit.Kerberos</code>.  This will let you omit the <code>@CS.STANFORD.EDU</code> part or even the entire argument when typing <code>kinit</code> commands. </para></section><section><title>Configure SSH</title><para>Stanford IT Service's KCT app will add a few lines to your <code>~/.ssh/config</code> resembling the following. </para><screen><![CDATA[# Stanford Kerberos Auth
Host *.stanford.edu
    GSSAPIDelegateCredentials yes
    GSSAPIAuthentication yes]]></screen><para>You may want to enable a few more options to avoid some known issues since Lion (10.7). </para><screen><![CDATA[    GSSAPIKeyExchange yes
    GSSAPITrustDNS yes]]></screen><para>If you were using <code>@stanford.edu</code> for single sign-on (to corn/cardinal farmshare machines or WebAuth), and/or want to use <code>@CS.STANFORD.EDU</code> realm along with it smoothly, you should specify which principal each host expects explicitly in <code>~/.ssh/config</code>.  SSH logins will then work for hosts in both realms regardless of your active Kerberos credential cache.  Otherwise, you will have to go through the hassle of switching back and forth with at least <code>kswitch -i</code> command each time you login to a host in different realm. </para><screen><![CDATA[Host il*.stanford.edu  madmax*.stanford.edu rulk.stanford.edu hulk.stanford.edu rocky.stanford.edu rambo.stanford.edu bruce.stanford.edu zarya.stanford.edu eel.stanford.edu  snap.stanford.edu shark.stanford.edu skate.stanford.edu whale.stanford.edu silk.stanford.edu
    GSSAPIClientIdentity your_cs_id@CS.STANFORD.EDU
]]><![CDATA[
Host *.stanford.edu
    GSSAPIClientIdentity your_sunetid@stanford.edu]]></screen></section><section><title>GUI for Managing/Refreshing Kerberos Tickets</title><para>There's an excellent app built-in to OS X for managing Kerberos tickets, called Ticket Viewer. (No need to rely on tedious <code>klist</code>/<code>kinit</code> commands from Terminal or other crappy Kerberos login apps.)  This gem is hidden in an obscure place: <code>/System/Library/CoreServices/Ticket Viewer.app</code>.  You can open it once by navigating to the location with Finder (Cmd+Shift+G) or from Terminal (<code>open ...</code> command), and keep the icon on your Dock to make it handy. </para><para><inlinemediaobject><imageobject><imagedata fileref="http://snap.stanford.edu/moin//moin/SshKerberosMac?action=AttachFile&amp;do=get&amp;target=TicketViewerScreenshot.png"/></imageobject><textobject><phrase>Screenshot of Ticket Viewer</phrase></textobject></inlinemediaobject> </para></section><section><title>References</title><itemizedlist><listitem><para><ulink url="http://web.mit.edu/macdev/KfM/Common/Documentation/preferences-osx.html">Kerberos Preferences on Mac OS X Documentation</ulink> </para></listitem><listitem><para><ulink url="http://tig.csail.mit.edu/wiki/TIG/InstallingKerberosOnMacOSX">Installing Kerberos On Mac OS X - CSAIL, MIT</ulink> </para></listitem><listitem><para><ulink url="http://www.slac.stanford.edu/comp/unix/sshGSSAPI.html">Using SSH and GSSAPI authentication - SLAC, Stanford</ulink> </para></listitem><listitem><para><ulink url="http://www.h5l.org/manual/HEAD/info/heimdal/Credential-cache-server-_002d-KCM.html">Tips on Credential cache server - KCM - HEIMDAL</ulink> </para></listitem></itemizedlist></section></section></article>