<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/"/>

<title>Jeff Epler's blog</title>
<modified>2005-12-18T03:49:33Z</modified>
<tagline>Photos, electronics, cnc, and more</tagline>
<author><name>Jeff Epler</name><email>jepler@unpythonic.net</email></author>
<entry>
<title>pam_ssh</title>
<issued>2005-12-18T03:49:33Z</issued>
<modified>2005-12-18T03:49:33Z</modified>
<id>http://emergent.unpythonic.net/software/01134877773</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/software/01134877773"/>
<content type="text/html" mode="escaped">
&lt;div style=&quot;float:right;clear:right&quot;&gt;&lt;!-- pam-ssh.png--&gt;&lt;div class=albumouter style=width:306px id=&gt;&lt;div class=albumimage style=&quot;width:306px;margin-left:0px;&quot;&gt;&lt;img src=&quot;http://media.unpythonic.net/emergent-files/software/01134877773/pam-ssh.png&quot;&gt;&lt;br&gt;&lt;span&gt;A console login mediated by pam_ssh&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
This is neat.  &lt;a href=&quot;http://pam-ssh.sourceforge.net/&quot;&gt;pam_ssh&lt;/a&gt; &amp;quot;provides
single sign-on behavior for SSH. The user types an SSH passphrase when logging
in (probably to GDM, KDM, or XDM) and is authenticated if the passphrase
successfully decrypts the user's SSH private key. In the PAM session phase, an
ssh-agent process is started and keys are added. For the entire session, the
user can SSH to other hosts that accept key authentication without typing any
passwords.&amp;quot;

&lt;p&gt;The only snag I ran into on FC2 was that the script in &lt;tt&gt;
 /etc/X11/xdm/Xsession&lt;/tt&gt; unconditionally started a fresh ssh-agent, even if &lt;tt&gt;
 $SSH_AGENT_PID&lt;/tt&gt; was already set.  I changed the SSHAGENT= line to read
&lt;span class=indent&gt;&lt;tt&gt;[ -x /usr/bin/ssh-agent &amp;amp;&amp;amp; -z &amp;quot;$SSH_AGENT_PID&amp;quot; ] &amp;amp;&amp;amp; SSHAGENT=&amp;quot;/usr/bin/ssh-agent&amp;quot;&lt;/tt&gt;&lt;/span&gt;
and then everything worked.  I'm now using it for console and gdm logins on one
of my machines.

&lt;p&gt;On FC2 I built the rpm from the tarball.  It looks like FC4 has one available
via yum.

&lt;p&gt;&lt;b&gt;Update 2006/01/09:&lt;/b&gt; I was having trouble with pam_ssh not leaving an
ssh-agent running the next time I logged in after a crash (dead battery).  I
discovered that the problem was that leftover &lt;tt&gt;~/.ssh/agent-*&lt;/tt&gt; files would
trick pam_ssh into thinking that an appropriate ssh-agent was already running.
I now remove these files in /etc/rc.local when booting.
</content>
</entry>
</feed>

