<?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>The World Of Gavin &#187; ssh</title>
	<atom:link href="http://www.gavinwillingham.com/tag/ssh/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gavinwillingham.com</link>
	<description>My opinions on things I have opinions on</description>
	<lastBuildDate>Fri, 28 Jan 2011 17:08:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SSH</title>
		<link>http://www.gavinwillingham.com/ssh.html</link>
		<comments>http://www.gavinwillingham.com/ssh.html#comments</comments>
		<pubDate>Wed, 25 Nov 2009 15:28:21 +0000</pubDate>
		<dc:creator>gavin</dc:creator>
				<category><![CDATA[Content]]></category>
		<category><![CDATA[authorized_keys]]></category>
		<category><![CDATA[pageant]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[puttygen]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.gavinwillingham.com/?p=466</guid>
		<description><![CDATA[Secure SHell allows a user to log in to a remote system to do command line stuff. SSH without a password (Windows) If logging in frequently to boxes, typing your password every time can get very tedious. Here&#8217;s a quick guide to setting up private/public key authentication using PuTTY, Pageant and PuTTYgen. 1. Download tools [...]]]></description>
			<content:encoded><![CDATA[<p>Secure SHell allows a user to log in to a remote system to do command line stuff.</p>
<h2>SSH without a password (Windows)</h2>
<p>If logging in frequently to boxes, typing your password every time can get very tedious. Here&#8217;s a quick guide to setting up private/public key authentication using PuTTY, Pageant and PuTTYgen.</p>
<h3>1. Download tools</h3>
<p>Visit the <a title="PuTTY" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuTTY website</a> and get the 3 required tools: PuTTY, Pageant and PuTTYgen.</p>
<h3>2. Run PuTTYgen</h3>
<p>Run the PuTTYgen tool to generate a key. This should be pretty obvious; you click generate and do some mouse-wiggling. When the key is generated, save both the private and public keys.</p>
<h3>3. Copy your public key to the target machine</h3>
<p>SSH into your target machine using PuTTY or command-line ssh if you prefer, then make sure you&#8217;re in your home directory</p>
<pre>cd ~/</pre>
<p>Check you have a .ssh directory, and if not, make one</p>
<pre>ls -a | grep .ssh
mkdir .ssh
cd .ssh</pre>
<p>Next up, open the <strong>public</strong> key file in wordpad or similar and copy the whole contents, then paste it into a new file called <code>authorized_keys2</code> on the remote system using vi/nano/cat etc, then create a soft link called <code>authorized_keys</code>. <strong>Check if this file doesn&#8217;t already exist!</strong> If it does, don&#8217;t overwrite it, paste into the existing file.</p>
<pre>cat &gt; authorized_keys2
ln -s authorized_keys2 authorized_keys</pre>
<h3>3a. Possibly convert the file</h3>
<p>I had a problem where even after providing my public key, I was still prompted for my password. A quick search pulled up <a title="Using Putty SSH Keys to Authenticate Automatically" href="http://www.stevekallestad.com/blog/using_putty_ssh_keys_to_authenticate_automatically.html">this</a> page, which suggested that something was getting buggered during the copy/paste phase.</p>
<pre>ssh-keygen -i -f authorized_keys2 &gt; authorized_keys2NEW
rm authorized_keys2
mv authorized_keys2NEW authorized_keys2</pre>
<p>This didn&#8217;t work at first (UUEncode error), as I&#8217;d created my file using <code>cat</code>, so I recreated it using <code>nano</code> and re-ran the command. All was now good.</p>
<h3>4. Load the private key in pageant</h3>
<p>Now run the pageant program and open your private key (right click on the icon in the system tray). Now when you run PuTTY, you will no longer be prompted for a password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavinwillingham.com/ssh.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

