<?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>blog.lundscape.com &#187; SSH Agent</title>
	<atom:link href="http://blog.lundscape.com/tag/ssh-agent/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lundscape.com</link>
	<description>The Linux Journey</description>
	<lastBuildDate>Tue, 31 Jan 2012 01:55:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Privileged SSH Port Forwarding with Sudo</title>
		<link>http://blog.lundscape.com/2010/08/privileged-ssh-port-forwarding-with-sudo/</link>
		<comments>http://blog.lundscape.com/2010/08/privileged-ssh-port-forwarding-with-sudo/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 14:52:59 +0000</pubDate>
		<dc:creator>Zachary Lund</dc:creator>
				<category><![CDATA[Secure Shell]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[SSH Agent]]></category>
		<category><![CDATA[SSH Key]]></category>
		<category><![CDATA[SSH Port Forwarding]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://blog.lundscape.com/?p=319</guid>
		<description><![CDATA[There are many articles about privileged SSH port forwarding but not much about properly using SSH keys and config files. The problem is that upon typing: ssh dakara -L 80:localhost:80 the response is: Privileged ports can only be forwarded by root. The obvious solution is to just use sudo: sudo ssh dakara -L 80:localhost:80 but [...]]]></description>
			<content:encoded><![CDATA[<p>There are many articles about <a href="http://aplawrence.com/Security/ssh_forwarding.html">privileged SSH port forwarding</a> but not much about properly using SSH keys and config files.</p>
<p>The problem is that upon typing:</p>
<pre>ssh dakara -L 80:localhost:80</pre>
<p>the response is:</p>
<pre>Privileged ports can only be forwarded by root.</pre>
<p>The obvious solution is to just use sudo:</p>
<pre>sudo ssh dakara -L 80:localhost:80</pre>
<p>but this produces:</p>
<pre>ssh: Could not resolve hostname dakara: Name or service not known</pre>
<p>Unfortunately, &#8220;dakara&#8221; is a host configured in ~/.ssh/config and not available to root. This can be fixed with:</p>
<pre>sudo ssh -F ~/.ssh/config dakara -L 80:localhost:80</pre>
<p>but this tries to connect as root and prompts for a password. Adding &#8220;-l $USER&#8221; sets the user name to my user name (This could also be set in the SSH config file.), and adding &#8220;-E&#8221; to sudo preserves the environment allowing my SSH agent to be used.</p>
<pre>sudo -E ssh -F ~/.ssh/config -l $USER dakara -L 80:localhost:80</pre>
<p>Now everything connects, and I am not prompted for a password.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lundscape.com/2010/08/privileged-ssh-port-forwarding-with-sudo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add an SSH Key to an SSH Agent on a Different Machine</title>
		<link>http://blog.lundscape.com/2009/02/add-an-ssh-key-to-an-ssh-agent-on-a-different-machine/</link>
		<comments>http://blog.lundscape.com/2009/02/add-an-ssh-key-to-an-ssh-agent-on-a-different-machine/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 04:40:49 +0000</pubDate>
		<dc:creator>Zachary Lund</dc:creator>
				<category><![CDATA[Secure Shell]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[SSH Agent]]></category>
		<category><![CDATA[SSH Key]]></category>

		<guid isPermaLink="false">http://blog.lundscape.com/?p=9</guid>
		<description><![CDATA[I recently discovered that I can add an SSH key to an SSH agent on a different machine. I find this useful because I am very protective of my SSH keys and prefer to keep them on my desktop (Dakara) and not on my laptop (Adria).]]></description>
			<content:encoded><![CDATA[<p>I recently discovered that I can add an SSH key to an SSH agent on a different machine. I find this useful because I am very protective of my SSH keys and prefer to keep them on my desktop (Dakara) and not on my laptop (Adria).</p>
<p>On Adria, you can see that I have no keys added:</p>
<pre>zac@adria:~$ ssh-add -l
The agent has no identities.</pre>
<p>I then secure shell to Dakara and forward my agent (-A) from Adria. I still have no keys added:</p>
<pre>zac@adria:~$ ssh dakara -A
zac@dakara's password:
No mail.
Last login: Mon Feb  9 17:30:49 2009 from adria.lund
zac@dakara:~$ ssh-add -l
The agent has no identities.</pre>
<p>Next, I add a key from Dakara to my agent on Adria:</p>
<pre>zac@dakara:~$ ssh-add
Enter passphrase for /home/zac/.ssh/id_dsa:
Identity added: /home/zac/.ssh/id_dsa (/home/zac/.ssh/id_dsa)
zac@dakara:~$ ssh-add -l
2048 27:81:f8:7f:38:75:6b:ce:95:e4:46:62:02:9c:84:bd /home/zac/.ssh/id_dsa (DSA)</pre>
<p>When I log out of Dakara, the key is still available on Adria:</p>
<pre>zac@dakara:~$ logout
Connection to dakara closed.
zac@adria:~$ ssh-add -l
2048 27:81:f8:7f:38:75:6b:ce:95:e4:46:62:02:9c:84:bd /home/zac/.ssh/id_dsa (DSA)</pre>
<p>Now my key is available on Adria without ever being on Adria. Even with physical access to my laptop, it would take a sophisticated hacker to steal my SSH key.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lundscape.com/2009/02/add-an-ssh-key-to-an-ssh-agent-on-a-different-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

