<?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; Ubuntu</title>
	<atom:link href="http://lostentropy.com/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostentropy.com</link>
	<description>Aaron B. Russell&#039;s personal blog</description>
	<lastBuildDate>Mon, 17 May 2010 21:54:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<script type="text/javascript">
if (typeof Meebo == "undefined") {
Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};
(function(q){

	var args = arguments;
	if (!document.body) { return setTimeout(function(){ args.callee.apply(this, args) }, 100); }
	var d=document, b=d.body, m=b.insertBefore(d.createElement('div'), b.firstChild); s=d.createElement('script');
	m.id='meebo'; m.style.display='none'; m.innerHTML='<iframe id="meebo-iframe"></iframe>';
	s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;
	b.insertBefore(s, b.firstChild);

})({network:'lostentropy_pi27li'});	}</script>	<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 X 10.6.3 client and an Ubuntu 10.04 server, with just one small change to the [...]]]></description>
			<content:encoded><![CDATA[<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>
<img style='display:none' id="post-2423-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/',title:'Make a perfect Ubuntu AFP file server with Time Machine support',tweet:' Just found an awesome guide from Mattias Kretschmann on how to create a perfect AFP file server for',description:' Just found an awesome guide from Mattias Kretschmann on how to create a perfect AFP file server for'})"><script type='text/javascript'>document.getElementById("post-2423-blankimage").onload();</script><!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" href="http://del.icio.us/post?url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Del.icio.us" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Del.icio.us" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Del.icio.us" /></a><a class="social_img" href="http://digg.com/submit?phase=2&amp;url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to digg" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to digg" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to digg" /></a><a class="social_img" href="http://furl.net/storeIt.jsp?t=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support&amp;u=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to FURL" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/furl.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to FURL" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to FURL" /></a><a class="social_img" href="http://reddit.com/submit?url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to reddit" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to reddit" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to reddit" /></a><a class="social_img" href="http://feedmelinks.com/categorize?from=toolbar&amp;op=submit&amp;name=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support&amp;url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;version=0.7" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Feed Me Links" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/feedmelinks.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Feed Me Links" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Feed Me Links" /></a><a class="social_img" href="http://www.technorati.com/faves?add=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Technorati" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Technorati" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Technorati" /></a><a class="social_img" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;t=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Yahoo My Web" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Yahoo My Web" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Yahoo My Web" /></a><a class="social_img" href="http://ekstreme.com/socializer/?url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Socializer" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/socializer.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Socializer" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Socializer" /></a><a class="social_img" href="http://ma.gnolia.com/bookmarklet/add?url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support&amp;description=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Ma.gnolia" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/magnolia.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Ma.gnolia" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Ma.gnolia" /></a><a class="social_img" href="http://www.stumbleupon.com/submit?url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Stumble Upon" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Stumble Upon" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Stumble Upon" /></a><a class="social_img" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Google Bookmarks" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Google Bookmarks" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Google Bookmarks" /></a><a class="social_img" href="http://www.bloglines.com/sub/http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Bloglines" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/bloglines.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Bloglines" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Bloglines" /></a><a class="social_img" href="http://www.netscape.com/submit/?U=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;T=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Propeller" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/propeller.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Propeller" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Propeller" /></a><a class="social_img" href="http://mystuff.ask.com/mysearch/QuickWebSave?v=1.2&amp;t=webpages&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support&amp;url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Ask" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/ask.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Ask" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Ask" /></a><a class="social_img" href="https://favorites.live.com/quickadd.aspx?url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Live-MSN" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Live-MSN" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Live-MSN" /></a><a class="social_img" href="http://slashdot.org/bookmark.pl?title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support&amp;url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to SlashDot" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to SlashDot" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to SlashDot" /></a><a class="social_img" href="http://www.facebook.com/share.php?u=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;t=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to FaceBook" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to FaceBook" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to FaceBook" /></a><a class="social_img" href="http://www.mixx.com/submit?page_url=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/&amp;title=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Mixx" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/mixx.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Mixx" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Mixx" /></a><a class="social_img" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Make+a+perfect+Ubuntu+AFP+file+server+with+Time+Machine+support&amp;c=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to MySpace" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to MySpace" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to MySpace" /></a><a class="social_img" href="http://twitter.com/home?status=http://lostentropy.com/2010/05/11/make-a-perfect-ubuntu-afp-file-server-with-time-machine-support/" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Twitter" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/twitter.png" title="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Twitter" alt="Add 'Make a perfect Ubuntu AFP file server with Time Machine support' to Twitter" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></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>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, it&#8217;s also brings with it SFTP; a fantastic alternative to the very insecure FTP. Except [...]]]></description>
			<content:encoded><![CDATA[<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>
<img style='display:none' id="post-2273-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/',title:'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)',tweet:' If you&#8217;re running a Linux, Mac OS X or Unix server of any description, SSH is an invaluable t',description:' If you&#8217;re running a Linux, Mac OS X or Unix server of any description, SSH is an invaluable t'})"><script type='text/javascript'>document.getElementById("post-2273-blankimage").onload();</script><!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" href="http://del.icio.us/post?url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Del.icio.us" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Del.icio.us" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Del.icio.us" /></a><a class="social_img" href="http://digg.com/submit?phase=2&amp;url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to digg" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to digg" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to digg" /></a><a class="social_img" href="http://furl.net/storeIt.jsp?t=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29&amp;u=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to FURL" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/furl.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to FURL" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to FURL" /></a><a class="social_img" href="http://reddit.com/submit?url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to reddit" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to reddit" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to reddit" /></a><a class="social_img" href="http://feedmelinks.com/categorize?from=toolbar&amp;op=submit&amp;name=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29&amp;url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;version=0.7" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Feed Me Links" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/feedmelinks.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Feed Me Links" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Feed Me Links" /></a><a class="social_img" href="http://www.technorati.com/faves?add=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Technorati" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Technorati" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Technorati" /></a><a class="social_img" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;t=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Yahoo My Web" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Yahoo My Web" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Yahoo My Web" /></a><a class="social_img" href="http://ekstreme.com/socializer/?url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Socializer" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/socializer.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Socializer" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Socializer" /></a><a class="social_img" href="http://ma.gnolia.com/bookmarklet/add?url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29&amp;description=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Ma.gnolia" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/magnolia.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Ma.gnolia" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Ma.gnolia" /></a><a class="social_img" href="http://www.stumbleupon.com/submit?url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Stumble Upon" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Stumble Upon" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Stumble Upon" /></a><a class="social_img" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Google Bookmarks" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Google Bookmarks" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Google Bookmarks" /></a><a class="social_img" href="http://www.bloglines.com/sub/http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Bloglines" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/bloglines.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Bloglines" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Bloglines" /></a><a class="social_img" href="http://www.netscape.com/submit/?U=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;T=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Propeller" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/propeller.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Propeller" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Propeller" /></a><a class="social_img" href="http://mystuff.ask.com/mysearch/QuickWebSave?v=1.2&amp;t=webpages&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29&amp;url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Ask" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/ask.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Ask" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Ask" /></a><a class="social_img" href="https://favorites.live.com/quickadd.aspx?url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Live-MSN" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Live-MSN" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Live-MSN" /></a><a class="social_img" href="http://slashdot.org/bookmark.pl?title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29&amp;url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to SlashDot" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to SlashDot" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to SlashDot" /></a><a class="social_img" href="http://www.facebook.com/share.php?u=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;t=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to FaceBook" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to FaceBook" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to FaceBook" /></a><a class="social_img" href="http://www.mixx.com/submit?page_url=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/&amp;title=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Mixx" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/mixx.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Mixx" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Mixx" /></a><a class="social_img" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Lock+down+SFTP+without+restricting+SSH+on+Ubuntu+8.10+%28Intrepid+Ibex%29&amp;c=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to MySpace" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to MySpace" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to MySpace" /></a><a class="social_img" href="http://twitter.com/home?status=http://lostentropy.com/2009/01/11/lock-down-sftp-without-restricting-ssh-on-ubuntu-810-intrepid-ibex/" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Twitter" border="0" ><img src="http://lostentropy.com/wp-content/plugins/social-bookmarking-reloaded/twitter.png" title="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Twitter" alt="Add 'Lock down SFTP without restricting SSH on Ubuntu 8.10 (Intrepid Ibex)' to Twitter" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></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>21</slash:comments>
		</item>
	</channel>
</rss>
