<?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>Lost Entropy &#187; Mac OS X</title>
	<atom:link href="http://lostentropy.com/tag/mac-os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostentropy.com</link>
	<description>Aaron B. Russell&#039;s personal blog</description>
	<lastBuildDate>Thu, 01 Mar 2012 07:04:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Removing stuck Finder sidebar items in OS X Lion and Snow Leopard</title>
		<link>http://lostentropy.com/2011/07/21/removing-stuck-finder-sidebar-items-in-os-x-lion-and-snow-leopard/</link>
		<comments>http://lostentropy.com/2011/07/21/removing-stuck-finder-sidebar-items-in-os-x-lion-and-snow-leopard/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 15:22:05 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Apple Inc.]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[File managers]]></category>
		<category><![CDATA[Finder]]></category>
		<category><![CDATA[Graphical user interface]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mac OS X Lion]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X Lion]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[User interface]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2508</guid>
		<description><![CDATA[Having trouble removing some pesky icons that have gotten stuck in the Finder&#8217;s sidebar? If you&#8217;re on Lion or Snow Leopard, the solution is easy: Click on the folder and drag it away from the sidebar Before you let go &#8230; <a href="http://lostentropy.com/2011/07/21/removing-stuck-finder-sidebar-items-in-os-x-lion-and-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:60px;'><a class='shareaholic-fblike' data-shr_layout='box_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Flostentropy.com%2F2011%2F07%2F21%2Fremoving-stuck-finder-sidebar-items-in-os-x-lion-and-snow-leopard%2F' data-shr_title='Removing+stuck+Finder+sidebar+items+in+OS+X+Lion+and+Snow+Leopard'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2011%2F07%2F21%2Fremoving-stuck-finder-sidebar-items-in-os-x-lion-and-snow-leopard%2F' data-shr_title='Removing+stuck+Finder+sidebar+items+in+OS+X+Lion+and+Snow+Leopard'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="Mac OS X Leopard - New Finder" href="http://flickr.com/photos/27273974@N00/544031637"><img src="http://farm2.static.flickr.com/1201/544031637_d6c7d9c2c7.jpg" alt="" /></a></p>
<p>Having trouble removing some pesky icons that have gotten stuck in the Finder&#8217;s sidebar? If you&#8217;re on Lion or Snow Leopard, the solution is easy:</p>
<ol>
<li>Click on the folder and drag it away from the sidebar</li>
<li>Before you let go of the mouse button, hold down the Command (⌘) key</li>
<li>Now that you&#8217;re holding down the Command (⌘) key, release the mouse button</li>
<li>The icon should now finally disappear from your sidebar in a puff of smoke</li>
<li>Hooray!</li>
</ol>
<p>(Credit: <a href="http://forums.macrumors.com/showthread.php?t=543117">Hybridair at MacRumors Forums</a>)</p>
<p><strong>Update 2011-08-20:</strong> Did you find this post helpful? It would be awesome if you&#8217;d take a moment or two to check out <a href="http://filesanctuary.net/?from=finder-sidebar-post">File Sanctuary</a>, my hosting company. We&#8217;d love to help you with web hosting, email hosting, radio station hosting, domain registration, SSL certificates, and even giving you a safe place on the Internet to back your computers up to. We really care about the service we provide, and our prices are really good. <a href="http://filesanctuary.net/?from=finder-sidebar-post">Have a look around our website to find out some more</a>, then get in touch and tell us what you need, and we&#8217;ll do everything we can to accomodate you. Thank you for reading my shameless plug! :)</p>
<div class="shr-publisher-2508"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2011/07/21/removing-stuck-finder-sidebar-items-in-os-x-lion-and-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>78</slash:comments>
		</item>
		<item>
		<title>Safari skews web stats</title>
		<link>http://lostentropy.com/2011/02/22/safari-skews-web-stats/</link>
		<comments>http://lostentropy.com/2011/02/22/safari-skews-web-stats/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 21:56:45 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[User agent]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[web stats]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2485</guid>
		<description><![CDATA[Here&#8217;s an interesting thing to consider next time you&#8217;re looking through your web stats: the popularity of Safari 4 and later (the desktop version, not the iOS one) probably looks way higher than it actually is. Safari&#8217;s &#8220;Top Sites&#8221; feature &#8230; <a href="http://lostentropy.com/2011/02/22/safari-skews-web-stats/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:60px;'><a class='shareaholic-fblike' data-shr_layout='box_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Flostentropy.com%2F2011%2F02%2F22%2Fsafari-skews-web-stats%2F' data-shr_title='Safari+skews+web+stats'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2011%2F02%2F22%2Fsafari-skews-web-stats%2F' data-shr_title='Safari+skews+web+stats'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="100" href="http://flickr.com/photos/44124355621@N01/513163712"><img src="http://farm1.static.flickr.com/190/513163712_134b858024.jpg" alt="" /></a></p>
<p>Here&#8217;s an interesting thing to consider next time you&#8217;re looking through your web stats: the popularity of Safari 4 and later (the desktop version, not the iOS one) probably looks way higher than it actually is.</p>
<p>Safari&#8217;s &#8220;Top Sites&#8221; feature checks sites to see if any content has changed since you were last there (and also to draw the preview images), and it does this reasonably often. The way it checks is to load your website behind the scenes, which means your server gets hit, and your stats show Safari&#8217;s more popular with each refresh.</p>
<p>Perhaps Apple should make the background thread use a different user agent string so that we can differentiate real requests from the Top Sites updates?</p>
<div class="shr-publisher-2485"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2011/02/22/safari-skews-web-stats/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make a perfect Ubuntu AFP file server with Time Machine support</title>
		<link>http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/</link>
		<comments>http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/#comments</comments>
		<pubDate>Tue, 11 May 2010 10:17:44 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Apple Filing Protocol]]></category>
		<category><![CDATA[Computer networking]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Cryptographic software]]></category>
		<category><![CDATA[file server]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Netatalk]]></category>
		<category><![CDATA[Network architecture]]></category>
		<category><![CDATA[Network file systems]]></category>
		<category><![CDATA[Network protocols]]></category>
		<category><![CDATA[Secure Shell]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2423</guid>
		<description><![CDATA[Just found an awesome guide from Mattias Kretschmann on how to create a perfect AFP file server for Mac clients that supports Time Machine backups over the network out of the box. It worked for me with a Mac OS &#8230; <a href="http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:60px;'><a class='shareaholic-fblike' data-shr_layout='box_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Flostentropy.com%2F2010%2F05%2F11%2Fmake-a-perfect-ubuntu-afp-file-server-with-time-machine-support%2F' data-shr_title='Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2010%2F05%2F11%2Fmake-a-perfect-ubuntu-afp-file-server-with-time-machine-support%2F' data-shr_title='Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignnone" src="http://www.kremalicious.com/media/ubuntu_mac_feature.jpg" alt="" width="420" height="278" /></p>
<p>Just found an awesome guide from <a href="http://www.kremalicious.com/">Mattias Kretschmann</a> on <a href="http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/">how to create a perfect AFP file server</a> for Mac clients that supports Time Machine backups over the network out of the box. It worked for me with a Mac OS X 10.6.3 client and an Ubuntu 10.04 server, with just one small change to the <code>/etc/netatalk/afpd.conf</code> file. The final line simply needed to read:</p>
<blockquote><p><code>- -transall -advertise_ssh</code></p></blockquote>
<p>Beautiful, thanks Mattias. :)</p>
<div class="shr-publisher-2423"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Certificate Assistant says certificate already exists</title>
		<link>http://lostentropy.com/2010/02/06/certificate-assistant-says-certificate-already-exists/</link>
		<comments>http://lostentropy.com/2010/02/06/certificate-assistant-says-certificate-already-exists/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 01:08:57 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Certificate Authority]]></category>
		<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Documents]]></category>
		<category><![CDATA[Electronic commerce]]></category>
		<category><![CDATA[Free software]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Key management]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Macs]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[Public key certificate]]></category>
		<category><![CDATA[Public-key cryptography]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2396</guid>
		<description><![CDATA[Just over a year ago, I created a bunch of SSL certs following the instructions here: http://www.devklog.net/2008/05/25/generating-ssl-certificates-that-will-make-firefox-3-happy/ I&#8217;m having some interesting problems creating a new certificate to replace an expired one. When I created a new certificate (as a leaf of &#8230; <a href="http://lostentropy.com/2010/02/06/certificate-assistant-says-certificate-already-exists/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:60px;'><a class='shareaholic-fblike' data-shr_layout='box_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Flostentropy.com%2F2010%2F02%2F06%2Fcertificate-assistant-says-certificate-already-exists%2F' data-shr_title='Certificate+Assistant+says+certificate+already+exists'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2010%2F02%2F06%2Fcertificate-assistant-says-certificate-already-exists%2F' data-shr_title='Certificate+Assistant+says+certificate+already+exists'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="GPG" href="http://flickr.com/photos/67909013@N00/72441466"><img src="http://farm1.static.flickr.com/20/72441466_862b166924.jpg" alt="" width="420" height="315" /></a><br />
Just over a year ago, I created a bunch of SSL certs following the instructions here: <a href="http://www.devklog.net/2008/05/25/generating-ssl-certificates-that-will-make-firefox-3-happy/">http://www.devklog.net/2008/05/25/generating-ssl-certificates-that-will-make-firefox-3-happy/</a></p>
<p>I&#8217;m having some interesting problems creating a new certificate to replace an expired one.</p>
<p>When I created a new certificate (as a leaf of a self-signed CA cert), to replace the expired leaf, I got a message saying that the certificate already existed.</p>
<p>I backed up and then deleted the expired cert and tried again, to no avail.</p>
<p>I saw <a href="http://discussions.apple.com/thread.jspa?messageID=7434613#7434613">this old thread</a> which seems related to the problems I&#8217;m having, but the solutions there didn&#8217;t help me (I&#8217;m already manually picking serial numbers in the format yyyymmddnn, where nn is the number of certificates I&#8217;ve created that day, and deleting the Certificate Authority folder from Application Support in my home library didn&#8217;t make a difference either).</p>
<p>Anyone else had similar trouble? How did you resolve it?</p>
<div class="shr-publisher-2396"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2010/02/06/certificate-assistant-says-certificate-already-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling FreeImage in 64-bit on Snow Leopard</title>
		<link>http://lostentropy.com/2009/10/03/compiling-freeimage-in-64-bit-on-snow-leopard/</link>
		<comments>http://lostentropy.com/2009/10/03/compiling-freeimage-in-64-bit-on-snow-leopard/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 15:31:16 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[FreeImage]]></category>
		<category><![CDATA[ImageScience]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Tiger]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2367</guid>
		<description><![CDATA[I recently tried to use the image_science gem for Ruby, but it didn&#8217;t work after installation because it was looking for FreeImage.h. Thinking it&#8217;d be an easy fix, I headed over to http://freeimage.sourceforge.net/ to go grab a copy of a &#8230; <a href="http://lostentropy.com/2009/10/03/compiling-freeimage-in-64-bit-on-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:60px;'><a class='shareaholic-fblike' data-shr_layout='box_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Flostentropy.com%2F2009%2F10%2F03%2Fcompiling-freeimage-in-64-bit-on-snow-leopard%2F' data-shr_title='Compiling+FreeImage+in+64-bit+on+Snow+Leopard'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2009%2F10%2F03%2Fcompiling-freeimage-in-64-bit-on-snow-leopard%2F' data-shr_title='Compiling+FreeImage+in+64-bit+on+Snow+Leopard'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="Profile of Djamila" href="http://flickr.com/photos/8070463@N03/2848818561"><img src="http://farm4.static.flickr.com/3189/2848818561_764c2c2831.jpg" alt="" width="425" height="282" /></a><br />
I recently tried to use the image_science gem for Ruby, but it didn&#8217;t work after installation because it was looking for FreeImage.h. Thinking it&#8217;d be an easy fix, I headed over to <a href="http://freeimage.sourceforge.net/">http://freeimage.sourceforge.net/</a> to go grab a copy of a binary file to install, but there wasn&#8217;t one.</p>
<p>Undeterred, I went to <a href="http://downloads.sourceforge.net/freeimage/FreeImage3120.zip">grab the source</a> and compile it myself. It didn&#8217;t work. Eventually I figured there were two key issues:</p>
<ol>
<li>FreeImage&#8217;s source was prepared for Mac OS X 10.3 (Panther)</li>
<li>FreeImage was trying to compile for i386 (32-bit) and my Ruby install is x86-64 (64-bit)</li>
</ol>
<p>First problem is easy to fix, just replace both instances of <code>/Developer/SDKs/MacOSX10.3.9.sdk</code> with <code>/Developer/SDKs/MacOSX10.6.sdk</code> (or, 10.5 for Leopard, or 10.4u for Tiger).</p>
<p>The second part was a bit more fiddly because I wasn&#8217;t sure if order was important, so I started by replacing all instances of <code>i386</code> and <code>I386</code> with <code>x86_64</code> and <code>X86_64</code> respectively. Then, I replaced all instances of <code>ppc</code> and <code>PPC</code> with <code>i386</code> and <code>I386</code>.</p>
<p>If you don&#8217;t want to worry about making all these changes, you can simply <a href="http://unadopted.co.uk/freeimage/Makefile.osx">download my Makefile.osx here</a>. It&#8217;s built for Snow Leopard, but it&#8217;s easy to change it for Leopard or Tiger.</p>
<div class="shr-publisher-2367"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2009/10/03/compiling-freeimage-in-64-bit-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Fixing CPAN on Snow Leopard (Mac OS X 10.6)</title>
		<link>http://lostentropy.com/2009/09/09/fixing-cpan-on-snow-leopard-mac-os-x-10-6/</link>
		<comments>http://lostentropy.com/2009/09/09/fixing-cpan-on-snow-leopard-mac-os-x-10-6/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 17:32:41 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Compress]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Macs]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripting languages]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Uncompress]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2345</guid>
		<description><![CDATA[I ran into some problems with Perl&#8217;s CPAN installer on Snow Leopard, notably, it didn&#8217;t work once Bundle::CPAN was installed. Every time I tried to install a package I&#8217;d end up with an error like this: Catching error: 'Can\'t call &#8230; <a href="http://lostentropy.com/2009/09/09/fixing-cpan-on-snow-leopard-mac-os-x-10-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:60px;'><a class='shareaholic-fblike' data-shr_layout='box_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Flostentropy.com%2F2009%2F09%2F09%2Ffixing-cpan-on-snow-leopard-mac-os-x-10-6%2F' data-shr_title='Fixing+CPAN+on+Snow+Leopard+%28Mac+OS+X+10.6%29'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2009%2F09%2F09%2Ffixing-cpan-on-snow-leopard-mac-os-x-10-6%2F' data-shr_title='Fixing+CPAN+on+Snow+Leopard+%28Mac+OS+X+10.6%29'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="My MacBook Etching" href="http://flickr.com/photos/41894166582@N01/301812211"><img src="http://farm1.static.flickr.com/116/301812211_5684bc0a75.jpg" alt="" width="420" height="280" /></a><br />
I ran into some problems with Perl&#8217;s CPAN installer on Snow Leopard, notably, it didn&#8217;t work once Bundle::CPAN was installed. Every time I tried to install a package I&#8217;d end up with an error like this:</p>
<blockquote>
<pre>Catching error: 'Can\'t call method "value" on an undefined value at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/IO/Uncompress/RawInflate.pm line 64.
' at /System/Library/Perl/5.10.0/CPAN.pm line 281
CPAN::shell() called at /usr/bin/cpan5.10.0 line 199</pre>
</blockquote>
<p>Not good. So, how to fix it? <em>Move the broken IO::Uncompress module out of the way.</em> In a terminal window, copy and paste the following</p>
<blockquote>
<pre>sudo mv /System/Library/Perl/5.10.0/darwin-thread-multi-2level/IO/Uncompress/RawInflate.pm /System/Library/Perl/5.10.0/darwin-thread-multi-2level/IO/Uncompress/RawInflate.pm-broken</pre>
</blockquote>
<p>Once that&#8217;s been shifted out the way, it should work provided CPAN was configured with the proper paths to your tar, bzip2 and gzip executables (if not, nuke your /System/Library/Perl/5.10.0/CPAN/Config.pm and start over).</p>
<p><strong>Note:</strong> This isn&#8217;t a long-term solution, some things like CPAN::SQLite won&#8217;t install if IO::Uncompress::RawInflate is missing, but at least it gets some functionality back into CPAN. I&#8217;m very interested in hearing of any better fixes for this.</p>
<div class="shr-publisher-2345"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2009/09/09/fixing-cpan-on-snow-leopard-mac-os-x-10-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)</title>
		<link>http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/</link>
		<comments>http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 01:12:08 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[invaluable tool]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[SCP]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[web hosting]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2273</guid>
		<description><![CDATA[If you&#8217;re running a Linux, Mac OS X or Unix server of any description, SSH is an invaluable tool when it comes to taking control of the machine while you&#8217;re not infront of it. In the world of web hosting, &#8230; <a href="http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:60px;'><a class='shareaholic-fblike' data-shr_layout='box_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Flostentropy.com%2F2009%2F01%2F11%2Flock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex%2F' data-shr_title='Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2009%2F01%2F11%2Flock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex%2F' data-shr_title='Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="El pequeño BOB" href="http://flickr.com/photos/89585721@N00/48396519"><img src="http://farm1.static.flickr.com/26/48396519_28383f1d18.jpg" alt="" width="405" height="304" /></a></p>
<p>If you&#8217;re running a Linux, Mac OS X or Unix server of any description, SSH is an invaluable tool when it comes to taking control of the machine while you&#8217;re not infront of it.</p>
<p>In the world of web hosting, it&#8217;s also brings with it SFTP; a fantastic alternative to the very insecure FTP. Except it has one major flaw: by default on Ubuntu (and most Linux distros), one user can see all of another user&#8217;s files just by dropping up a directory to /home. Not exactly ideal if you&#8217;re providing a shared-hosting service.</p>
<p>So what we want is a chrooted version of SFTP. But this would also chroot SSH too, making it unusable for system administration. So we need to lock down SFTP only, but let SSH run free. We also want to be able to make some users SFTP-only (web hosting customers), and some users SFTP and SSH capable.</p>
<p>Luckily someone known as &#8220;The Minstrel&#8221;, came up with <a href="http://www.minstrel.org.uk/papers/sftp/">a pretty good solution to this</a>. Back in November 2007, Mads Madsen also created <a href="http://zephid.dk/2007/11/20/getting-the-power-of-sftp-chroot-in-debian/">a guide to this process for Debian/Ubuntu 7.04</a>. This has been my favourite solution for some time now. The OpenSSH project has since created a version of this this idea internally, but annoyingly it&#8217;s got a major flaw: <em>wherever you want to chroot the users to must be owned by root</em>. In other words, users will not be able to create any files in the top level of their chroot jail.</p>
<p>Imagine that you have your users data stored in /home/username. You can&#8217;t chroot them to /home/username unless you create a directory inside there, and then let them own that. That gives them an ugly chrooted writable path like /htdocs (or whatever you choose to call it), and a / folder they can&#8217;t edit. The other option is to chroot them to /home, and let them own their homedir as normal, but then they can see every other user&#8217;s files. Again, not ideal.</p>
<p>So I stuck with The Minstrel&#8217;s version, but got tired of having to recompile and rebuild all this every time I wanted it on a new machine. Some people would have probably avoided this (actually quite good) solution altogether because it&#8217;s a bit too indepth. Well, it just got a bunch easier, because I created all the bits needed and am publishing them here for you to use.</p>
<p>Disclaimer: I make no promises that this won&#8217;t electrocute your cat, sleep with your girlfriend, make fun of your children, etc. Infact I make no promises about this at all. That said, for me, this has worked very well several times since Ubuntu 8.10&#8242;s release, on a whole variety of machines, and I&#8217;ve had no problems with it.</p>
<p>So from your Ubuntu machine, fire up a terminal (or SSH in, if you&#8217;re not sat infront of it) and paste this in:</p>
<blockquote>
<pre>wget http://unadopted.co.uk/openssh/openssh-server_5.1p1-3ubuntu1_i386.deb
sudo dpkg -i openssh-server_5.1p1-3ubuntu1_i386.deb
sudo aptitude hold openssh-server</pre>
</blockquote>
<p>This will download the modified package, install it, and tell Ubuntu not to replace it with new any of Ubuntu&#8217;s versions. Now bear in mind that you won&#8217;t get automatic security updates on OpenSSH anymore &#8212; you&#8217;ll need a new version of this package when OpenSSH 5.2 comes out, but when that comes out, it&#8217;ll be a pretty simple copy/paste job to upgrade, just like that was. The Minstrel notes that it&#8217;s worth signing up to the <a href="http://lists.mindrot.org/mailman/listinfo/openssh-unix-announce">openssh-unix-announce</a> mailing list to find out when this is necessary.</p>
<p>Now if this is the first time you&#8217;re doing this we need to do a couple extra steps (though you won&#8217;t need to do this if you&#8217;re just updating):</p>
<blockquote>
<pre>wget http://unadopted.co.uk/openssh/sftpsh
sudo cp sftpsh /bin/sftpsh
sudo chown root:root /bin/sftpsh
sudo chmod 755 /bin/sftpsh
sudo echo "/bin/sftpsh" &gt;&gt; /etc/shells </pre>
</blockquote>
<p>This will download and install a special shell which you&#8217;ll need to set up as the login shell for the user accounts for whoever you want to lock down. This will kick them straight out if they try and SSH in, but will still let SFTP work. We also need to tell the system which directory to lock them into by adding a special tag into their home folder definition. Which all sounds a bit more complicated than it really is (it&#8217;s just one line to copy and paste).</p>
<p>So, let&#8217;s say our web user is called &#8220;mywebsite-sftp&#8221;. We&#8217;d just do this, if we wanted to lock them to their home directory:</p>
<blockquote>
<pre>sudo usermod -s /bin/sftpsh -d /home/mywebsite-sftp/./ mywebsite-sftp</pre>
</blockquote>
<p>Simple, right? The Minstrel has built up a <a href="http://www.minstrel.org.uk/papers/sftp/faq.html">pretty good set of FAQs</a> incase you run into any problems.</p>
<p>If you ever change your mind, and want to go back to Ubuntu&#8217;s default OpenSSH server and undo all these changes, that&#8217;s dead simple too, just copy and paste this in (go-go-gadget uninstaller!):</p>
<blockquote>
<pre>sudo rm /bin/sftpsh
sudo aptitude remove openssh-server
sudo aptitude install openssh-server </pre>
</blockquote>
<p>Warning: If you&#8217;re SSH&#8217;d in, don&#8217;t disconnect between the two aptitude commands, or you won&#8217;t have an SSH server to reconnect to (but it will stay alive until you disconnect). Also, you&#8217;ll need to remember that the sftpsh shell doesn&#8217;t exist anymore, though, and you&#8217;ll need to change any users back to a different shell using usermod.</p>
<p>Okay, so that&#8217;s that over with. Tell your friends, post it on Facebook, link to this in forum posts, Digg it, link to this from the Ubuntu Wiki, do whatever you feel you must do to share this with the world. :)</p>
<div class="shr-publisher-2273"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

