<?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>Emmense Technologies, LLC - WordPress Consulting &#187; os x — Emmense Technologies, LLC - WordPress Consulting</title>
	<atom:link href="http://emmense.com/blog/tag/os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://emmense.com</link>
	<description>Just another Emmense.com weblog</description>
	<lastBuildDate>Sat, 05 Jun 2010 14:13:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
		<item>
		<title>SSHKey Management Made Easy</title>
		<link>http://emmense.com/blog/2009/12/15/sshkey-management-made-easy/</link>
		<comments>http://emmense.com/blog/2009/12/15/sshkey-management-made-easy/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 18:02:41 +0000</pubDate>
		<dc:creator>Aaron Brazell</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[dsa]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshkeys]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://emmense.com/?p=229</guid>
		<description><![CDATA[I&#8217;ve been working with Linux for years now, and one of the main things you learn early on is that it&#8217;s better to use an SSHKey than it is to use a password. It gets confusing to some people (including myself), sometimes, where things are supposed to go to make it simple to do password-less [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Femmense.com%2Fblog%2F2009%2F12%2F15%2Fsshkey-management-made-easy%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Femmense.com%2Fblog%2F2009%2F12%2F15%2Fsshkey-management-made-easy%2F" height="61" width="51" /></a></div><p>I&#8217;ve been working with Linux for years now, and one of the main things you learn early on is that it&#8217;s better to use an SSHKey than it is to use a password. It gets confusing to some people (including myself), sometimes, where things are supposed to go to make it simple to do password-less entry into a server.</p>
<p>I started using this script in 2007 and have kept it around and use it regularly (whenever I need to log on to other servers other than my own). It was originally somewhere on the internet, and I&#8217;ve taken it and modified it further.</p>
<p>Make sure this script is executable. It won&#8217;t work on Windows since Microsoft still hasn&#8217;t introduced native SSH. But it will work on Mac OS X or Linux variants.</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #007800;">KEY</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.ssh/id_dsa.pub&quot;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa.pub <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #000000; font-weight: bold;">then</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;private key not found at <span style="color: #007800;">$KEY</span>&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;* please create it with &quot;</span><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> dsa<span style="color: #ff0000;">&quot; *&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> $1 <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #000000; font-weight: bold;">then</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Please specify user@host.tld as the first switch to this script&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Putting your key on $1... &quot;</span><br />
<br />
<span style="color: #007800;">KEYCODE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$KEY</span><span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-q</span> $<span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;mkdir ~/.ssh 2&amp;gt;/dev/null; chmod 700 ~/.ssh; echo &quot;</span><span style="color: #007800;">$KEYCODE</span><span style="color: #ff0000;">&quot; &amp;gt;&amp;gt; ~/.ssh/authorized_keys; chmod 644 ~/.ssh/authorized_keys&quot;</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;done!&quot;</span></div></td></tr></tbody></table></div>
<p>It is invoked simply by typing:</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ncc-<span style="color: #000000;">1701</span>$ .<span style="color: #000000; font-weight: bold;">/</span>do_sshkeys.sh sshuser<span style="color: #000000; font-weight: bold;">@</span>sshhost.tld</div></td></tr></tbody></table></div>
<p>Clearly, substitute sshuser with your username and sshhost.tld with your IP address or servername. (Also, ncc-1701$ is my command prompt &#8211; don&#8217;t type that) You&#8217;ll have to enter the password the first time, then the script will take your DSA public key and place it in the appropriate place on the remote server. Logout and try logging in normally and, if all goes well, you&#8217;ll login without having to enter your password.</p>
]]></content:encoded>
			<wfw:commentRss>http://emmense.com/blog/2009/12/15/sshkey-management-made-easy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
