<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Björn Schießle&#039;s Weblog &#187; fedora</title>
	<atom:link href="http://blog.schiessle.org/tag/fedora/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.schiessle.org</link>
	<description></description>
	<lastBuildDate>Fri, 12 Feb 2010 01:37:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Fedora and gpg-agent</title>
		<link>http://blog.schiessle.org/2009/05/12/fedora-and-gpg-agent/</link>
		<comments>http://blog.schiessle.org/2009/05/12/fedora-and-gpg-agent/#comments</comments>
		<pubDate>Tue, 12 May 2009 16:28:37 +0000</pubDate>
		<dc:creator>Björn</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[gnupg]]></category>
		<category><![CDATA[smartcard]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.schiessle.org/blog/?p=260</guid>
		<description><![CDATA[While it was quite easy to set up my Fellowship smartcard for SSH logins on Debian GNU/Linux following this instructions I never managed to get it working on Fedora GNU/Linux. At some point of time I just gave up. Today finally I found a solution in an on-line forum. The problem was that gpg-agent always [...]]]></description>
			<content:encoded><![CDATA[<p>While it was quite easy to set up my <a href="http://fellowship.fsfe.org">Fellowship</a> smartcard for SSH logins on Debian GNU/Linux following this <a href="http://blogs.fsfe.org/greve/?p=64">instructions</a> I never managed to get it working on Fedora GNU/Linux. At some point of time I just gave up. Today finally I found a solution in an on-line forum.</p>
<p>The problem was that gpg-agent always stopped with the error message:</p>
<pre>
$ gpg-agent
gpg-agent[2857]: can't connect to `/home/schiesbn/.gnupg/S.gpg-agent': No such file or directory
gpg-agent: no gpg-agent running in this session
</pre>
<p>By default the gpg-agent on Fedora creates the socket in /tmp instead of in /home/schiesbn/.gnupg. So you have to move it manually over to your home directory once gpg-agent has started.</p>
<p>To do this I use this script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Decide whether to start gpg-agent daemon.</span>
<span style="color: #666666; font-style: italic;"># Create necessary symbolic link in $HOME/.gnupg/S.gpg-agent</span>
&nbsp;
<span style="color: #007800;">SOCKET</span>=S.gpg-agent
<span style="color: #007800;">PIDOF</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">pidof</span> gpg-agent<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RETVAL</span>&quot;</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting gpg-agent daemon.&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #000000; font-weight: bold;">`</span>gpg-agent <span style="color: #660033;">--daemon</span> <span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Daemon gpg-agent already running.&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Nasty way to find gpg-agent's socket file...</span>
<span style="color: #007800;">GPG_SOCKET_FILE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>gpg-<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #660033;">-name</span> <span style="color: #007800;">$SOCKET</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating socket file link.&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-fs</span> <span style="color: #007800;">$GPG_SOCKET_FILE</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>S.gpg-agent</pre></div></div>

<p>To execute this script during log-in I have added this to my ~/.bashrc:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># GPG-AGENT stuff</span>
<span style="color: #007800;">GET_TTY</span>=<span style="color: #000000; font-weight: bold;">`</span>tty<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">$GET_TTY</span>
<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gpg-agent-start.sh</pre></div></div>

<p>I still wonder why it works that easy on Debian and on Fedora i need all this scripting. But for the moment I&#8217;m just happy that I have found a solution to use my smartcard for SSH login on my Fedora systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schiessle.org/2009/05/12/fedora-and-gpg-agent/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
