<?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>Fri, 06 Jan 2012 02:54:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Switching between Ubuntu Desktop and Ubuntu Server</title>
		<link>http://lostentropy.com/2011/04/11/switching-between-ubuntu-desktop-and-ubuntu-server/</link>
		<comments>http://lostentropy.com/2011/04/11/switching-between-ubuntu-desktop-and-ubuntu-server/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 03:16:51 +0000</pubDate>
		<dc:creator>Aaron B. Russell</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Free software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux distributions]]></category>
		<category><![CDATA[Software projects]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lostentropy.com/?p=2495</guid>
		<description><![CDATA[It&#8217;s easy enough to start out with an Ubuntu Server machine and install the desktop packages, leaving you with an Ubuntu Desktop machine. Just run: sudo aptitude install ubuntu-desktop &#8230;and you&#8217;re done. Unfortunately, going the other way isn&#8217;t so easy. &#8230; <a href="http://lostentropy.com/2011/04/11/switching-between-ubuntu-desktop-and-ubuntu-server/">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%2F04%2F11%2Fswitching-between-ubuntu-desktop-and-ubuntu-server%2F' data-shr_title='Switching+between+Ubuntu+Desktop+and+Ubuntu+Server'></a><a class='shareaholic-tweetbutton' data-shr_count='vertical' data-shr_href='http%3A%2F%2Flostentropy.com%2F2011%2F04%2F11%2Fswitching-between-ubuntu-desktop-and-ubuntu-server%2F' data-shr_title='Switching+between+Ubuntu+Desktop+and+Ubuntu+Server'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="Laptop Compubody Sock" href="http://flickr.com/photos/23243094@N00/2414194397"><img src="http://farm3.static.flickr.com/2106/2414194397_9a484b1d75.jpg" alt="" /></a></p>
<p>It&#8217;s easy enough to start out with an Ubuntu Server machine and install the desktop packages, leaving you with an Ubuntu Desktop machine. Just run:</p>
<blockquote>
<pre>sudo aptitude install ubuntu-desktop</pre>
</blockquote>
<p>&#8230;and you&#8217;re done. Unfortunately, going the other way isn&#8217;t so easy. Just removing the ubuntu-desktop package doesn&#8217;t remove all the other packages for me, I had to list a whole bunch of packages (enough to trigger all the dependencies, and get all the other desktop packages autoremoved). Long story short, I just fired this (very long) command and it did what I was after:</p>
<blockquote>
<pre>sudo aptitude remove ubuntu-desktop gdm nautilus \
xserver-xorg libgtk2.0-common metacity x-session-manager \
gnome-session xorg capplets-data gedit-common \
gnome-panel gnome-orca gnome-control-center libgnome2-0 \
mousetweaks network-manager synaptic evolution \
gcalctool gconf2 software-center nautilus-data \
rhythmbox vino vlc update-manager firefox compiz-core \
network-manager-pptp openoffice.org-help-en-us \
gnome-media-common gnome-panel-data gnome-screensaver \
gnome-terminal-data gstreamer0.10-plugins-base \
indicator-me indicator-messages indicator-session \
update-notifier indicator-applet \
indicator-applet-session libappindicator1 \
libcanberra-gtk0 empathy-common evolution-common \
evolution-plugins gwibber-service ibus jockey-gtk \
libbrasero-media1 libpam-gnome-keyring \
nautilus-sendto-empathy rhythmbox-plugins \
xul-ext-ubufox empathy gnome-applets gnome-keyring</pre>
</blockquote>
<p><strong>Warnings/disclaimers/tips:</strong></p>
<ul>
<li>Make sure you&#8217;re not in a GNOME session while you&#8217;re doing this, or it could have unexpected results.</li>
<li>It&#8217;ll remove a lot more packages than those listed above. Read the list of packages that are going to be removed CAREFULLY and be sure before you confirm the removal.</li>
<li>You may not hold me responsible if you hose your system by blindly removing packages. You should know what you&#8217;re doing before attempting this, if you&#8217;re not sure what will happen, you should do some more research first.</li>
<li>If you don&#8217;t have aptitude installed, just replace &#8220;aptitude&#8221; with &#8220;apt-get&#8221; in the commands above. I prefer aptitude, so that&#8217;s why it&#8217;s in the commands above.</li>
<li>My scenario: I started off with an Ubuntu Server 10.10 (not a fresh install, I&#8217;d been using it a while, so forget this being a clean experiment!), then installed the Desktop, installed Chromium and Flash, then switched back to Ubuntu Server.</li>
<li>This will almost certainly need some tweaks to work on earlier or later versions of Ubuntu than 10.10. If you do tweak the above command for another version and you feel like helping out, please comment with the relevant remove command that worked for you so it can be shared.</li>
</ul>
<p>If this works for you, drop me a comment below!</p>
<p>PS: Nope, I don&#8217;t understand that photo either. :)</p>
<div class="shr-publisher-2495"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://lostentropy.com/2011/04/11/switching-between-ubuntu-desktop-and-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>3</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>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>

