<?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>Untitled &#187; security</title>
	<atom:link href="http://ammonlauritzen.com/blog/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://ammonlauritzen.com/blog</link>
	<description>and still for good reason.</description>
	<lastBuildDate>Wed, 05 May 2010 18:43:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>flash socket policies update</title>
		<link>http://ammonlauritzen.com/blog/2008/04/21/flash-socket-policies-update/</link>
		<comments>http://ammonlauritzen.com/blog/2008/04/21/flash-socket-policies-update/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 18:57:02 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ammonlauritzen.com/blog/?p=361</guid>
		<description><![CDATA[I&#8217;ve been getting a lot of positive feedback recently on the post I made last December on this topic, so it&#8217;s probably time to post an update.
Last week, Adobe finally released some help for people who need to provide socket policy services. They&#8217;ve got python and perl versions of the socket policy daemon that look [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been getting a lot of positive feedback recently on <a href='http://ammonlauritzen.com/blog/2007/12/13/new-flash-security-policies/'>the post</a> I made last December on this topic, so it&#8217;s probably time to post an update.</p>
<p>Last week, Adobe finally released <a href='http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html'>some help</a> for people who need to provide socket policy services. They&#8217;ve got python and perl versions of the socket policy daemon that look like they can run either standalone or through xinetd. They don&#8217;t claim that the code is production quality yet&#8230; but it&#8217;s at least something.</p>
<p>Of course, I released sample PHP code 5 months ago&#8230; shrug.</p>
<p>My confederates and I have spent the intervening months sniffing packets, yelling at flash, rewriting daemons, etc&#8230; until settling upon a version of the service that appears to function reliably now. I am currently running it on 6 different servers and have seen it successfully handle requests from &gt;100 simultaneous users during stress tests.</p>
<p>The biggest problem with my previous versions of the code was how I handled closing of connections. Previously, I had simply accepted connections and fired off the policy xml without waiting for a request from the client.</p>
<p>This worked 95% of the time over a good net connection, and more like 80% of the time over a poor connection.</p>
<p>The reason it didn&#8217;t work consistently was because of weird tcp ordering issues. Connections would be closed out of order, the response would be received before the request was dispatched, etc..</p>
<p>My new version is much more robust and actually waits for flash to submit the request before sending the XML. I consider it <strike>release candidate</strike> beta quality code and hope to be able to release it later today.</p>
<h3>update</h3>
<p>Version 0.9.b is <a href='http://ammonlauritzen.com/blog/2008/04/22/flash-policy-service-daemon/'>available</a> now.</p>
]]></content:encoded>
			<wfw:commentRss>http://ammonlauritzen.com/blog/2008/04/21/flash-socket-policies-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>shared key gotchas</title>
		<link>http://ammonlauritzen.com/blog/2008/03/25/shared-key-gotchas/</link>
		<comments>http://ammonlauritzen.com/blog/2008/03/25/shared-key-gotchas/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 22:40:49 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://ammonlauritzen.com/blog/2008/03/25/shared-key-gotchas/</guid>
		<description><![CDATA[This is something that has kept coming back to bite me recently.
When you are setting up public-key authentication on OpenSSH, you must be very careful of file ownerships and permissions. In many stock unix setups, this isn&#8217;t a problem. But in any environment where you are relying on a lot of group access to files, [...]]]></description>
			<content:encoded><![CDATA[<p>This is something that has kept coming back to bite me recently.</p>
<p>When you are setting up public-key authentication on OpenSSH, you must be very careful of file ownerships and permissions. In many stock unix setups, this isn&#8217;t a problem. But in any environment where you are relying on a lot of group access to files, it is easy to slip up and earn yourself a system that will silently fail to authenticate (unless you turn on debug level verbosity).</p>
<ol>
<li>The private key must be readable only by the user initiating the connection.</li>
<li>The authorized_hosts file must be writable only by the account accepting the connection.</li>
</ol>
<p>Sounds simple enough, ne?</p>
<p>The real trick is that group write permission anywhere up the directory tree can render these precautions meaningless. Who cares if I can&#8217;t see into .ssh in your home directory if I can manipulate your home dir itself?</p>
<ol start='3'>
<li>$HOME and $HOME/.ssh must be locked down on the destination host.</li>
</ol>
<p>A general good rule of thumb for permissions might be something like this:</p>
<pre>
ammon@farnsworth:~$ <b>chmod 755 .</b>
ammon@farnsworth:~$ <b>chmod 700 .ssh</b>
ammon@farnsworth:~$ <b>chmod 600 .ssh/authorized_keys</b>
</pre>
<p>Obviously, this gets kind of tricksy if you want to do something like allow SCP file transfers to the Apache user on a system&#8230; and their home dir is /var/www&#8230; and your web developers have group write access to this dir.</p>
<p>In situations like that, you have two options. First, you could disable the permissions checks (by turning off StrictModes in the sshd_config), but that&#8217;s not advisable. Second, you could make a separate home dir for the apache user with the restrictions in a place where they won&#8217;t interfere with anyone&#8217;s work.</p>
]]></content:encoded>
			<wfw:commentRss>http://ammonlauritzen.com/blog/2008/03/25/shared-key-gotchas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>new flash security policies</title>
		<link>http://ammonlauritzen.com/blog/2007/12/13/new-flash-security-policies/</link>
		<comments>http://ammonlauritzen.com/blog/2007/12/13/new-flash-security-policies/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 22:14:20 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ammonlauritzen.com/blog/2007/12/13/new-flash-security-policies/</guid>
		<description><![CDATA[So&#8230; I am not happy with Adobe right now. With the push of Flash Player 9,0,115,0 &#8220;moviestar&#8221;, which included such awesome features as H.264 and AAC codec support and improvements to fullscreen mode, they kind of ambushed me with some sweeping changes to their security policy.
I&#8217;d been running pre-release nightly builds of the player since [...]]]></description>
			<content:encoded><![CDATA[<p>So&#8230; I am not happy with Adobe right now. With the push of Flash Player 9,0,115,0 &#8220;moviestar&#8221;, which included such awesome features as <a href='http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player.html'>H.264 and AAC</a> codec support and <a href='http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html'>improvements to fullscreen mode</a>, they kind of ambushed me with some sweeping changes to their security policy.</p>
<p>I&#8217;d been running pre-release nightly builds of the player since 9,0,60,x&#8230; and had noticed some strange warnings. Mysterious &#8220;Socket Security Error #2048&#8243; exceptions that were being thrown at random &#8211; even though I was serving an appropriate (for the time) crossdomain.xml file, unexplained timeouts attempting to talk to an xml socket server when I was very clearly not attempting to do any such thing, etc&#8230; My regularly repeated attempts to find documentation on what the warnings actually meant proved fruitless. I believe that is because <a href='http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html'>the appropriate document</a> was not actually released to the public until 9,0,115,0 was released.</p>
<p>Now, the bit where they improved the format for <a href='http://marstonstudio.com/index.php/2007/12/06/new-security-policy-settings-in-flash-moviestar/'>crossdomain.xml</a> files doesn&#8217;t really affect me one way or the other. I approve of the improvements but could really care less in this case. They don&#8217;t really affect anything I&#8217;m doing.</p>
<p>The part that really chaps my hide is the fact that they&#8217;ve completely redone the way that socket security policies are handled. The important parts:</p>
<blockquote>
<ul>
<li>A SWF file may no longer make a socket connection to its own domain without a socket policy file. Prior to version 9,0,115,0, a SWF file was permitted to make socket connections to ports 1024 or greater in its own domain without a policy file.</li>
<li>HTTP policy files may no longer be used to authorize socket connections. Prior to version 9,0,115,0, an HTTP policy file, served from the master location of /crossdomain.xml on port 80, could be used to authorize a socket connection to any port 1024 or greater on the same host.</li>
</ul>
</blockquote>
<p>That&#8217;s right. Your socket policy data can&#8217;t live in the sitewide crossdomain.xml file that Apache serves any more.</p>
<blockquote><p>
Flash Player 9,0,115,0 introduces a concept of socket master policy files, which are served from the fixed TCP port number 843.
</p></blockquote>
<blockquote><p>
Socket policy files may be obtained from the same port as a main connection (the socket connection being made by ActionScript, which is authorized by a socket policy file), or from a different port, separate from the main connection. If you opt to serve a socket policy file from the same port as a main connection, the server listening on that port must understand socket policy file requests (which are indicated by a transmission of
<policy-file-request/> from Flash Player), and must respond differently for policy file requests and main connection requests.
</p></blockquote>
<blockquote>
<ul>
<li>When a SWF file attempts to make a socket connection, even to its own domain, Flash Player will first attempt to contact port 843 to see if the host is serving a socket master policy file.</li>
</ul>
</blockquote>
<p>So&#8230; regardless of whether you&#8217;re even using a custom port 843 client, the Flash Player is going to try to hit it. What if your firewall doesn&#8217;t allow/route traffic to sub-1024 ports w/o special configuration? What if you don&#8217;t have the access to bind to a sub-1024 port and can&#8217;t rewrite your other server process to serve the policy data on its port?</p>
<blockquote>
<ul>
<li>Socket meta-policies can only be declared in a socket master policy file. The syntax is the same as for declaring a meta-policy in an URL master policy file, using the &lt;site-control&gt; tag. Socket meta-policies cannot be declared in HTTP response headers, as HTTP is not involved.</li>
</ul>
</blockquote>
<p>This implies that you can&#8217;t even tell apache to listen to port 843 and serve up the data. You HAVE to either maintain a separate server process specifically for the purpose of serving this policy data, or you have to edit the process that SWF&#8217;s are connecting to and make them serve the data..</p>
<p>As of the time of this writing (10 days after moviestar&#8217;s release), they have yet to release <a href='http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html'>promised help</a> on how to deploy a solution to these new changes. Granted, the one article they did release explains what needs to be done in high level terms. It was sufficient to help me out. I wrote a server that simply listens on port 843 and spews the required xml. But&#8230; I&#8217;d have really appreciated specific examples, and I suspect plenty of people would appreciate drop-in solutions to the issue.</p>
<p>A 5-minute skeleton implementation (not recommended for production use by any means) written as a PHP cli script might look something like this:</p>
<pre class="brush: php;">
#!/usr/bin/php
&lt;?
/**
 * Ugly Flash socket policy file service. This script must be run as root from
 * the command line. It binds to port 843 on all interfaces and waits
 * indefinitely for connections. When a connection is detected, the script spits
 * out a chunk of xml and disconnects. It can only serve one request at a time,
 * but that shouldn't be much of a problem.
 *
 * One potential problem with this script is that you can easily lock port 843
 * up for an indeterminate amount of time if the script doesn't exit cleanly.
 * The OS should clear the port up for you eventually, but you could be stuck
 * playing the waiting game.
 *
 * This particular version of the script has only been tested very lightly.
 * Deploy at your own peril <img src='http://ammonlauritzen.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  YMMV.
 *
 * - Ammon Lauritzen [12/13/07]
 */

// define the xml policy &quot;file&quot;
$policy_file =
	'&lt;'.'?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?'.'&gt;'.
	'&lt;cross-domain-policy xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd&quot;&gt;'.
        '&lt;allow-access-from domain=&quot;*&quot; to-ports=&quot;*&quot; secure=&quot;false&quot; /&gt;'.
        '&lt;site-control permitted-cross-domain-policies=&quot;master-only&quot; /&gt;'.
	'&lt;/cross-domain-policy&gt;';

// make sure everything launches correctly
if( posix_getuid() != 0 )
	die( &quot;You must run this script as root.\\\n&quot; );

$sock = @socket_create( AF_INET, SOCK_STREAM, SOL_TCP );
if( !$sock )
	die( &quot;Unable to create socket.\\\n&quot; );

$succ = @socket_bind( $sock, &quot;0.0.0.0&quot;, 843 );
if( !$succ )
	die( &quot;Unable to bind to port 843.\\\n&quot; );

$succ = @socket_listen( $sock );
if( !$succ )
	die( &quot;Unable to start listening.\\\n&quot; );

// start serving policies
while( true ) {
	$r = $w = $e = array( $sock );
	if( @socket_select( $r, $w, $e, null ) !== false ) {
		$conn = @socket_accept( $sock );
		if( $conn !== false ) {
			// somebody connected, just dump the xml and close
			socket_write( $conn, $policy_file );
			socket_close( $conn );
		} else {
			echo &quot;socket_accept() failed?\\\n&quot;;
			break;
		}
	} else {
		echo &quot;socket_select() failed?\\\n&quot;;
		break;
	}
}// end: listen forever

// clean up
socket_close( $sock );
?&gt;
</pre>
<p>I&#8217;ll try to make my production version of this a bit more suitable for public consumption and release it as soon as I can.</p>
<p>The random #2048 security errors continue, despite having deployed my port 843 policy xml server. Granted, they happen less than before&#8230; but they still happen. And even when my policy server isn&#8217;t running, the errors aren&#8217;t thrown 100% of the time. This just baffles me. If they were consistent, that would be one thing. But when you get a security error 1 time in 20&#8230; that&#8217;s not security, that&#8217;s not even a lame deterrent. It&#8217;s just incentive to hammer the same port over and over again until something finally gives.</p>
<p>Now, I admit that I could be wrong here&#8230; but I&#8217;ve re-re-read the documentation on these policies a few times now, and cannot find any reason for the behaviors I&#8217;m seeing.</p>
<h3>update</h3>
<p>On April 22nd, 2008, I released a much better, much more reliable version of this daemon. Head <a href='http://ammonlauritzen.com/blog/2008/04/22/flash-policy-service-daemon/'>over there</a> for more details and source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://ammonlauritzen.com/blog/2007/12/13/new-flash-security-policies/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>optional http auth</title>
		<link>http://ammonlauritzen.com/blog/2006/09/21/optional_http_auth/</link>
		<comments>http://ammonlauritzen.com/blog/2006/09/21/optional_http_auth/#comments</comments>
		<pubDate>Thu, 21 Sep 2006 19:38:03 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Today I encountered an interesting problem. (And please excuse any incoherent rambling right now, I&#8217;m writing this from a pretty loud office building where everyone&#8217;s getting ready to take off for lunch&#8230;)
A site I&#8217;m working on is currently restricted from public access (largely because we don&#8217;t want the client poking around while it&#8217;s in a [...]]]></description>
			<content:encoded><![CDATA[<p>Today I encountered an interesting problem. <i>(And please excuse any incoherent rambling right now, I&#8217;m writing this from a pretty loud office building where everyone&#8217;s getting ready to take off for lunch&#8230;)</i></p>
<p>A site I&#8217;m working on is currently restricted from public access (largely because we don&#8217;t want <a href='http://www.nasa.gov'>the client</a> poking around while it&#8217;s in a particularly ugly stage of development <img src='http://ammonlauritzen.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). We&#8217;re restricting this access via the standard issue apache http basic auth system with an .htaccess file that looks something like this:</p>
<pre class="brush: plain;">
AuthType        basic
AuthUserFile    /not/in/var/www/mars_passwd
AuthGroupFile   /dev/null
AuthName        &quot;MARS Password Required&quot;
Require         valid-user
</pre>
<p>This is all well and good. I have a secure password that the three people working on the site can use to access the pages in question and everything is good.</p>
<p>Until they tell me that they want me to make searches work &#8211; searches involving both static and dynamic content. Ie, searches that can only be indexed via some sort of spider application. But, the spider must run over http&#8230; and it&#8217;s too dumb to both authenticate connections AND leave the passwords out of the url&#8217;s it saves in its index&#8230;</p>
<p>Now, if I were only developing this site internally, I might want to change my .htaccess file to read something more like this:</p>
<pre class="brush: plain;">
Order allow,deny
Allow from localhost
Allow from xx.yy.zz.com
Deny from all
</pre>
<p>This would let the server do it&#8217;s thing w/o worries about the </p>
<p>Enter the <a href='http://httpd.apache.org/docs/1.3/howto/auth.html#satisfy'>Satisfy</a> directive.</p>
<p>See, Apache is smart enough to accept any possible combination of these two methods of authentication. It is possible to require both a valid password and a valid ip OR to require only one of the two.</p>
<p>Satisfy takes one of two arguments, &#8216;all&#8217; or &#8216;any&#8217;. But saying &#8216;Satisfy all&#8217; is kind of redundant, as that&#8217;s the default behavior.</p>
<p>The final auth file looks something like this:</p>
<pre class="brush: plain;">
AuthType        basic
AuthUserFile    /not/in/var/www/mars_passwd
AuthGroupFile   /dev/null
AuthName        &quot;MARS Password Required&quot;
Require         valid-user

Order allow,deny
Allow from localhost
Allow from xx.yy.zz.com

Satisfy any
</pre>
<p>So, now we get the desired behavior. If connecting from one of the authorized hosts, it lets you in w/o asking for a password. Otherwise, the password is required to continue.</p>
]]></content:encoded>
			<wfw:commentRss>http://ammonlauritzen.com/blog/2006/09/21/optional_http_auth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>shared key ssh authentication</title>
		<link>http://ammonlauritzen.com/blog/2006/04/16/shared_key_ssh_authentication/</link>
		<comments>http://ammonlauritzen.com/blog/2006/04/16/shared_key_ssh_authentication/#comments</comments>
		<pubDate>Mon, 17 Apr 2006 05:40:24 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[SSH supports a number of different methods of authenticating connections. The two most common are password and shared key (and I&#8217;m not going to talk about the others, since they&#8217;re for rather specific applications). By default, and in almost every case where people use SSH, they&#8217;re probably entering a password. This is generally good for [...]]]></description>
			<content:encoded><![CDATA[<p>SSH supports a number of different methods of authenticating connections. The two most common are password and shared key (and I&#8217;m not going to talk about the others, since they&#8217;re for rather specific applications). By default, and in almost every case where people use SSH, they&#8217;re probably entering a password. This is generally good for security, but bad for convenience, scripting, and a number of other things.</p>
<p>When setting up shared keys between two accounts, there is only really one big decision to be made &#8211; do you want to require a password or not? If you do so, that password is independant of either the source or destination accounts&#8217; passwords. If you don&#8217;t set a password on the key, you effectively merge the two accounts into one &#8211; making transitions between them very transparent in deed.</p>
<p>I tend not to set passwords on my ssh keys. This means that I can scp files between machines without having to type the password every time, which in turn means that I can run backup scripts over an encrypted connection or use gvim to edit a remote file securely without having to tunnel an entire X session. There are lots of uses.</p>
<p>But I digress. You just want to set it up, eh?</p>
<p>Suppose I am setting up passwordless stuff between two servers, Bender and Fry. The basic procedure for creating my key pair looks like this:</p>
<blockquote><pre>
ammon@bender:~$ <b>ssh-keygen -t rsa</b>
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ammon/.ssh/id_rsa): <b>[enter]</b>
Enter passphrase (empty for no passphrase): <b>[enter]</b>
Enter same passphrase again: <b>[enter]</b>
Your identification has been saved in /home/ammon/.ssh/id_rsa.
Your public key has been saved in /home/ammon/.ssh/id_rsa.pub.
The key fingerprint is:
88:99:60:ee:eb:e5:ac:1f:fb:fe:ae:83:5c:3c:c4:0b ammon@bender
</pre>
</blockquote>
<p>Obviously, your username &amp; hostname are probably going to be different, as is the generated fingerprint. This creates two files, <i>~/.ssh/id_rsa</i> and <i>~/.ssh/id_rsa.pub</i>. These are your private and public keys (respectively). And, because you didn&#8217;t type in a password when creating them, they&#8217;re not going to ask you for a password when you want to use them.</p>
<p>In addition to creating an RSA key, you could also create a DSA key, but RSA keys work with both SSH1 and SSH2 (not that you&#8217;re using SSH1, right?). For our application, there&#8217;s no real reason to choose one over the other.</p>
<p>Now that we have our keys, you need to send the public key to the other server. The SSH daemon looks for public keys of friendly accounts in <i>~/.ssh/authorized_keys</i>, so the process is probably going to be something like this:</p>
<blockquote><pre>
ammon@bender:~$ <b>scp .ssh/id_rsa.pub fry:.ssh/authorized_keys</b>
ammon@fry's password: <b>[password]</b>
id_rsa.pub                                    100%  996     1.0KB/s   00:00
</pre>
</blockquote>
<p>Now, if the universe is right, when I try to ssh over to Fry, I won&#8217;t be prompted for a password. To make things happy the other way around (to allow Fry to log in to Bender w/o a password), you just repeat the process the other way around. That is, create a key pair on Fry, copy the public key over to Bender.</p>
<p>If we were to add another server (Zoidberg) to the list, you&#8217;d repeat the process by creating a keypair over there and copying the public key to both Fry and Bender, and making sure Zoidberg&#8217;s authorized_keys file contains a copy of both Fry&#8217;s and Bender&#8217;s public keys. The more machines you add to the mix, the easier it is to forget to update one.</p>
<p>I find it helpful to make a copy of the public key in the form hostname.pub when generating a new key and copy it everywhere. Then, on the remote machines I execute a <b>cat *.pub > authorized_keys</b> to regenerate the index.</p>
<h3>warning</h3>
<p>And, just because I am such a good citizen, I figure I&#8217;ll close out with a warning. Be careful with this, if one machine in your little family of key-sharing happiness is compromised, the rest are. Also, it is healthy to keep track of which accounts can talk to which other accounts in order to track down/make changes in the future.</p>
<p>Case study:</p>
<p>At a previous job of mine, I had set up passwordless shared key ssh into the root account of one of the (non-mission critical) servers from my desktop, since that was the only place I was logging in from, and I was doing it a lot.</p>
<p>Well, 9 months after I quit, I typoed an ssh command &#8211; and wound up with root privs on the box. My brief examination of the machine showed that while the guy who replaced me <u>was</u> bright enough to change the root password itself when I left, he didn&#8217;t check for ssh keys. I discovered three other accounts that were similarly accessible by keys created by users who were no longer with the organization.</p>
<p>Yeah.</p>
]]></content:encoded>
			<wfw:commentRss>http://ammonlauritzen.com/blog/2006/04/16/shared_key_ssh_authentication/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
