<?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>Brooke Bryan - Make Life Easy, Automate Everything &#187; Keys</title>
	<atom:link href="http://www.bajb.net/tag/keys/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bajb.net</link>
	<description>Just Develop It</description>
	<lastBuildDate>Fri, 03 Feb 2012 01:21:29 +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>Quick Server Access : SSH Keys</title>
		<link>http://www.bajb.net/2009/03/quick-server-access-ssh-keys/</link>
		<comments>http://www.bajb.net/2009/03/quick-server-access-ssh-keys/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 21:12:02 +0000</pubDate>
		<dc:creator>Brooke Bryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Keys]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.bajb.net/?p=126</guid>
		<description><![CDATA[It has now reached the stage where I am logging into 20 &#8211; 40 different servers a day, which itself is quite time consuming when you know the server logins stored in your head.  However, all our servers have different access passwords and finding each server password takes a little too long (there is no [...]]]></description>
			<content:encoded><![CDATA[<p>It has now reached the stage where I am logging into 20 &#8211; 40 different servers a day, which itself is quite time consuming when you know the server logins stored in your head.  However, all our servers have different access passwords and finding each server password takes a little too long (there is no way I could remember all our server logins).</p>
<p>There is a great feature on UNIX  machines which will allow you to simply ssh into a server without the password as long as you have configured each machine.</p>
<p>The setup of this is pretty quick, there are only 3 main things you need to remember.</p>
<p>1. Generate the Key on the client box<br />
2. Copy the Key into your clipboard from the client box<br />
3. Enter the Key into  the server box from your clipboard</p>
<p><strong>Stage 1: Generating the Key</strong></p>
<pre>ssh-keygen -t dsa</pre>
<p>By running the above command, you will generate your client key.  You will be faced with a few questions, you should just be able to press enter with no answer on each question.</p>
<p>Generating public/private dsa key pair.<br />
Enter file in which to save the key (/root/.ssh/id_dsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /root/.ssh/id_dsa.<br />
Your public key has been saved in /root/.ssh/id_dsa.pub.<br />
The key fingerprint is:<br />
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>
<p><strong>Stage 2: Access the Key </strong></p>
<p>You will need to access the key that was just generated to place on your server so you can quickly access it.   First things first, you need to get the key onto the screen or into your email.  I would recommend using the screen output to avoid any formatting errors by your mail client.</p>
<p>Outputting onto the screen:</p>
<pre>cat ~/.ssh/id_dsa.pub</pre>
<p>Sending the output to your email:</p>
<pre>cat ~/.ssh/id_dsa.pub | mail email@domain.com</pre>
<p><strong>Stage 3: Storing the Key on the Server</strong><br />
Now you have the key, you just need to add it onto the server you are going to be SSH&#8217;ing into.</p>
<p>Open up the file &#8216;~/.ssh/authorized_keys&#8217; using your preferred editor.  I usually use nano, so:</p>
<pre>nano ~/.ssh/authorized_keys</pre>
<p>Then copy the key into the end of the file.  You need to ensure that the key stays on one line and you have one key per line.</p>
<p>Once you have saved the authorized_keys file, you should be able to hop back onto the client box and just type</p>
<pre>ssh root@hostname</pre>
<p>and you will be logged straight into shell on the &#8216;hostname&#8217; box.</p>
<p><strong>And thats all you need to do <img src='http://www.bajb.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<p>This has saved me soo much time on a day to day basis and probably given me an extra 30 mins &gt; 1 hour a day to get some real work done.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.bajb.net%2F2009%2F03%2Fquick-server-access-ssh-keys%2F&amp;title=Quick%20Server%20Access%20%3A%20SSH%20Keys" id="wpa2a_2">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bajb.net/2009/03/quick-server-access-ssh-keys/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

