<?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"
	>

<channel>
	<title>Ubuntu Tutorials : Dapper - Feisty - Gutsy - Hardy &#187; Security</title>
	<atom:link href="http://ubuntu-tutorials.com/category/security/feed" rel="self" type="application/rss+xml" />
	<link>http://ubuntu-tutorials.com</link>
	<description>How to do almost anything on your Ubuntu desktop, laptop or server.  Regular tips on installing, configuring and making your Ubuntu system as effective as you need it to be.</description>
	<pubDate>Fri, 04 Jul 2008 23:53:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
			<item>
		<title>Tunnel Web and DNS Traffic Over SSH</title>
		<link>http://ubuntu-tutorials.com/2008/06/18/tunnel-web-and-dns-traffic-over-ssh/</link>
		<comments>http://ubuntu-tutorials.com/2008/06/18/tunnel-web-and-dns-traffic-over-ssh/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 11:06:35 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[.ssh]]></category>

		<category><![CDATA[dns]]></category>

		<category><![CDATA[Encryption]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=679</guid>
		<description><![CDATA[

 I have been tunneling all of my web traffic over an encrypted SSH connection for some time now.  Considering the fact that I travel a lot, I&#8217;m very regularly on untrusted, insecure networks.  I prefer to secure those connections (web, IM, email, etc) by creating an encrypted SSH connection and pushing the [...]]]></description>
			<content:encoded><![CDATA[<p style="float: left;margin: 4px;"><script type="text/javascript"><!--
google_ad_client = "pub-2967906068469254";
google_ad_width = 250;
google_ad_height = 250;
google_ad_format = "250x250_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0066CC";
google_color_text = "000000";
google_color_url = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p> <p>I have been tunneling all of my web traffic over an encrypted SSH connection for some time now.  Considering the fact that I travel a lot, I&#8217;m very regularly on untrusted, insecure networks.  I prefer to secure those connections (web, IM, email, etc) by creating an encrypted SSH connection and pushing the traffic through it.  Today I also found a method for also pushing DNS requests through the same tunnel.  This ensures total privacy between yourself and the SSH Server.</p>
<p><strong>Step 1: Creating the Tunnel</strong></p>
<p>Creating this private connection you&#8217;ll need a remote SSH server to connect to.  Mine runs at home in my garage on an old Pentium III 500MHz box (yeah, the kind most people threw away long, long ago!).  I connect to this tunnel using:</p>
<blockquote><p><code>ssh -D 8080 -fN user@server</code></p></blockquote>
<p>This creates a SOCKS compatible proxy, which is a requirement of the DNS forwarding.  Other methods on the interwebs suggest using <code>ssh -L</code> or similar, which are not SOCKS compatible proxies.</p>
<p><strong>Step 2: Forwarding DNS</strong></p>
<p>If you&#8217;d like to also forward your DNS requests (ie; the site addresses you type into your browser), you&#8217;ll need to change a setting in Firefox.  This can be done by accessing the address <a title="about config - firefox configuration" href="about:config">about:config</a>, and entering this string into the configuration:</p>
<blockquote><p><code>network.proxy.socks_remote_dns</code></p></blockquote>
<p>Change this value to &#8220;true&#8221;.</p>
<p><strong>Step 3: Using the Tunnel</strong></p>
<p>The last step is to configure your browser to use these new settings.  In Firefox 3 (I hope you&#8217;ve upgraded by now), you can activate/toggle these settings via:</p>
<blockquote><p><code>Edit &gt; Preferences &gt; Advanced &gt; Network &gt; Settings</code></p></blockquote>
<p>Select &#8220;Manual Proxy Configuration&#8221; and add <code>localhost</code> to the &#8220;SOCKS Host:&#8221; field, followed by port <code>8080</code> (assuming you&#8217;ve used the port in the example above).</p>
<p><a href="http://ubuntu-tutorials.com/wp-content/uploads/2008/06/socks-proxy.png"><img class="alignnone size-thumbnail wp-image-680" style="clear left" style="border: 1px solid black; margin: 1px; float: left;" title="socks-proxy" src="http://ubuntu-tutorials.com/wp-content/uploads/2008/06/socks-proxy-150x150.png" alt="configure proxy in firefox" width="150" height="150" /></a></p>
<p>This will then forward your web traffic through the SSH tunnel and DNS requests will also be forwarded.</p>
<p>You may want to check out the <a title="foxyproxy firefox addon" href="https://addons.mozilla.org/en-US/firefox/addon/2464">FoxyProxy</a> plugin for a simpler way of toggling this on &amp; off.</p>
<p>To deactivate the tunneling and use the local DNS again simply revert Step 3 back to &#8220;Direct Connection to the Internet&#8221;.<br />
<h3>Related</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2008/06/12/use-vnc-encrypt-it-via-ssh/" title="Use VNC?  Encrypt It Via SSH">Use VNC?  Encrypt It Via SSH</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/29/what-would-you-like-to-see-poll-expiring-tomorrow/" title="&#8220;What Would You Like To See?&#8221; Poll Expiring Tomorrow">&#8220;What Would You Like To See?&#8221; Poll Expiring Tomorrow</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/25/install-adobe-acrobat-plugins-for-firefox/" title="Install Adobe Acrobat Plugins For Firefox">Install Adobe Acrobat Plugins For Firefox</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/22/firefox-shortcut-keys/" title="Firefox Shortcut Keys">Firefox Shortcut Keys</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/17/enhance-your-network-connection-with-opendns/" title="Enhance Your Network Connection With OpenDNS">Enhance Your Network Connection With OpenDNS</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/13/mozilla-firefox-easter-eggs/" title="Mozilla Firefox Easter Eggs">Mozilla Firefox Easter Eggs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/06/18/tunnel-web-and-dns-traffic-over-ssh/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Use VNC?  Encrypt It Via SSH</title>
		<link>http://ubuntu-tutorials.com/2008/06/12/use-vnc-encrypt-it-via-ssh/</link>
		<comments>http://ubuntu-tutorials.com/2008/06/12/use-vnc-encrypt-it-via-ssh/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 03:04:09 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[.ssh]]></category>

		<category><![CDATA[Encryption]]></category>

		<category><![CDATA[Privacy]]></category>

		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=667</guid>
		<description><![CDATA[I covered VNC this afternoon in my Linux system administration course and the question came up on how to secure VNC.  You may or may not be aware than VNC is not encrypted by default, which could be a security concern.
If you use VNC regularly to connect to other Linux machines you may want [...]]]></description>
			<content:encoded><![CDATA[<p>I covered VNC this afternoon in my Linux system administration course and the question came up on how to secure VNC.  You may or may not be aware than VNC is not encrypted by default, which could be a security concern.</p>
<p>If you use VNC regularly to connect to other Linux machines you may want to consider adding a level of encryption with SSH.  Here is a quick run-down on how that is done:</p>
<p>If you look at the man page for vncviewer (<code>man vncviewer</code>) you&#8217;ll notice there is a small section for <strong>-via</strong>.  The <strong>-via</strong> option, as outlined in the man page will do:</p>
<blockquote><p>Makes the connection go through SSH to a gateway host.  The gateway should be the target host for best connection secrecy.</p></blockquote>
<p>Basically this is saying that you can tunnel VNC over SSH within your connection command.  Let&#8217;s give it a try.</p>
<blockquote><p><code>vncviewer -via user@host localhost:0</code></p></blockquote>
<p>This, of course, will require that you have both ssh and vnc access to a remote machine.</p>
<p>This is a much simpler method than many other tutorials I&#8217;ve found which generally suggest creating a tunnel with ssh -L and then using that tunnel.<br />
<h3>Related</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2008/06/18/tunnel-web-and-dns-traffic-over-ssh/" title="Tunnel Web and DNS Traffic Over SSH">Tunnel Web and DNS Traffic Over SSH</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/06/12/use-vnc-encrypt-it-via-ssh/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenSSL &#038; OpenSSH Vulnerabilities : Confirm &#038; Fix Instructions</title>
		<link>http://ubuntu-tutorials.com/2008/05/13/openssh-openssh-vulnerabilities-confirm-fix-instructions/</link>
		<comments>http://ubuntu-tutorials.com/2008/05/13/openssh-openssh-vulnerabilities-confirm-fix-instructions/#comments</comments>
		<pubDate>Tue, 13 May 2008 19:49:34 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[openssh]]></category>

		<category><![CDATA[openssl]]></category>

		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=639</guid>
		<description><![CDATA[I&#8217;m sure many of you have heard by this point that there is a reported vulnerability in openSSL and openSSH.  The basis of this is that they keys that are generated when you use these tools (ie; installing openssh-server, etc) are generated in a weak manner and can be prone to simple brute force attacking.
If [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure many of you have heard by this point that there is a reported <a title="openssl key vulnerability" href="http://www.ubuntu.com/usn/usn-612-1">vulnerability in openSSL</a> and <a title="openssh key vulnerability" href="http://www.ubuntu.com/usn/usn-612-2">openSSH</a>.  The basis of this is that they keys that are generated when you use these tools (ie; installing openssh-server, etc) are generated in a weak manner and can be prone to simple brute force attacking.</p>
<p><strong>If you&#8217;ve never installed openssh-server, used openssh-clients or generated an X.509 certificate you should be safe.  If you <em>have</em> done any of the above keep reading for a validation and fix instructions.  It can&#8217;t hurt to run the validation script in either case, just to be safe.<br />
</strong></p>
<p>Security patches have been deployed to the Ubuntu archives so the first step is to, of course, apply any security patches available.</p>
<p><strong>Am I Affected?</strong></p>
<p>The first item at hand is verifying whether or not you have been affected by the vulnerability.  As mentioned above there are some common tasks that would qualify, but lets test your machine to make sure.</p>
<p>Download the script linked below and run it using the example syntax below:</p>
<p><a title="validate whether or not you are affected" href="http://security.debian.org/project/extra/dowkd/dowkd.pl.gz">dowkd.pl.gz</a> (Download this file and unzip)<a title="validate whether or not you are affected" href="http://security.debian.org/project/extra/dowkd/dowkd.pl.gz"><br />
</a></p>
<p><a title="validate the dowkd.pl script signature" href="http://security.debian.org/project/extra/dowkd/dowkd.pl.gz.asc">dowkd.pl PGP signature</a> (Optionally verify the signature of the script)</p>
<p>Cut-n-Paste command-line example of downloading and running the test:</p>
<blockquote><p><code>wget -c http://security.debian.org/project/extra/dowkd/dowkd.pl.gz<br />
gunzip dowkd.pl.gz<br />
chmod u+x dowkd.pl<br />
./dowkd.pl user<br />
./dowkd.pl host &lt;hostname&gt;</code></p></blockquote>
<p>If you see output similar to:</p>
<blockquote><p><code>/home/<em>username</em>/.ssh/id_dsa.pub:1: weak key</code></p></blockquote>
<p>&#8230;then you have been affected by the vulnerability.  If you do not see &#8220;weak key&#8221; reported then you are OK.</p>
<p><strong>How Do I Fix My Machine?</strong></p>
<p>To update your machine and patch the vulnerability the first thing you want to do is check for and apply any system updates available.  The main Ubuntu archives have been updated with the fixes.  If you are using an alternate mirror the fix may not have propagated yet, so you may not see it available for another few hours.</p>
<p>Apply any updates:</p>
<blockquote><p><code>sudo apt-get update<br />
sudo apt-get upgrade<br />
sudo apt-get dist-upgrade</code></p></blockquote>
<p>You should see an update for openssl and openssh packages (along with anything else available).</p>
<p>After these new packages have been applied you&#8217;ll want to regenerate any keys that you&#8217;ve generated (ie; openssh keys, CA cert, etc).</p>
<p><strong>UPDATE</strong>: The latest package release will automagically re-create any server-side ssh keys for you and notify you of the reason.  Also, there is a new utility built into the latest release that will check keys for you.  After your updates are applied try the tool:</p>
<blockquote><p><code>ssh-vulnkey</code></p></blockquote>
<p>To generate a new openssh key for your user: (This only required if &#8216;<code>./dowkd.pl user</code>&#8216; reports weak)</p>
<blockquote><p><code>ssh-keygen -t dsa -b 1024</code></p></blockquote>
<p>To generate a new openssh key for your server: (This only required if <code>./dowkd.pl host &lt;hostname</code>&gt; reports weak)</p>
<blockquote><p><code>sudo rm /etc/ssh/ssh_host_{dsa,rsa}_key*<br />
sudo dpkg-reconfigure -plow openssh-server</code></p></blockquote>
<p>You should now run the validation script again and make sure it does not report any errors.  If you still see reported warnings such as:</p>
<blockquote><p><code>/home/<em>username</em>/.ssh/authorized_hosts:1: weak key</code></p></blockquote>
<p>&#8230;this means that you have authorized_host keys saved that are still affected.  Open the .ssh/authorized_hosts file with a text editor and delete the affected line (:1: means line 1, etc).</p>
<p>Continue to run the ./dowkd.pl script until no weaknesses are reported.</p>
<p><strong>These steps should be run on any system that you manage to ensure they are sufficiently patched.</strong><br />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2007/02/02/ubuntu-704-feisty-herd-3-released/" title="Ubuntu 7.04 &#8220;Feisty&#8221; Herd 3 Released">Ubuntu 7.04 &#8220;Feisty&#8221; Herd 3 Released</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/08/14/privacy-and-encryption-with-pgp-signing-and-encrypting-email-files/" title="Privacy and Encryption with PGP : Signing and Encrypting Email / Files">Privacy and Encryption with PGP : Signing and Encrypting Email / Files</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/11/30/remove-duplicate-menu-entries-in-gnome-ubuntu-510-6061-610/" title="Remove duplicate menu entries in GNOME : Ubuntu (5.10 / 6.06.1 /6.10)">Remove duplicate menu entries in GNOME : Ubuntu (5.10 / 6.06.1 /6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/11/20/how-to-install-java-runtime-environment-jre-with-firefox-plugin-ubuntu-6061-610/" title="How to install Java Runtime Environment (JRE) with Firefox Plugin : Ubuntu (6.06.1 / 6.10)">How to install Java Runtime Environment (JRE) with Firefox Plugin : Ubuntu (6.06.1 / 6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/01/21/ubuntu-6062-lts-released/" title="Ubuntu 6.06.2 LTS Released">Ubuntu 6.06.2 LTS Released</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/06/10/biggest-pizza-ive-ever-seen/" title="Biggest Pizza I&#8217;ve Ever Seen">Biggest Pizza I&#8217;ve Ever Seen</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/04/29/debian-netinst/" title="Debian netinst">Debian netinst</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/27/gnome-and-nautilus-keyboard-shortcut-keys/" title="Gnome and Nautilus Keyboard Shortcut Keys">Gnome and Nautilus Keyboard Shortcut Keys</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/10/27/installing-sunbird-05-or-07-calendar-ubuntu-710/" title="Installing Sunbird 0.5 or 0.7 Calendar : Ubuntu 7.10">Installing Sunbird 0.5 or 0.7 Calendar : Ubuntu 7.10</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/04/27/javascript-to-the-rescue/" title="javascript to the rescue?">javascript to the rescue?</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/05/13/openssh-openssh-vulnerabilities-confirm-fix-instructions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why ufw Does Not Need A GUI</title>
		<link>http://ubuntu-tutorials.com/2008/05/04/why-ufw-does-not-need-a-gui/</link>
		<comments>http://ubuntu-tutorials.com/2008/05/04/why-ufw-does-not-need-a-gui/#comments</comments>
		<pubDate>Sun, 04 May 2008 19:16:55 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[firestarter]]></category>

		<category><![CDATA[firewall]]></category>

		<category><![CDATA[iptables]]></category>

		<category><![CDATA[netfilter]]></category>

		<category><![CDATA[ufw]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=636</guid>
		<description><![CDATA[I&#8217;ve been hearing more and more recent requests (at OpenWeek -chat and in blog comments) regarding a request for a GUI on top of ufw.  I wanted to take a second and outline more clearly what ufw is, which will likely stop these requests.  I think its just a simple matter of not truly understand [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been hearing more and more recent requests (at OpenWeek -chat and in blog comments) regarding a request for a GUI on top of ufw.  I wanted to take a second and outline more clearly what ufw is, which will likely stop these requests.  I think its just a simple matter of not truly understand what ufw does which leads to these.  Bottom line, there are already a number of GUI firewall applications, adding one for ufw would be basically pointless. (Before you argue that point, keep reading.)</p>
<p><strong>What is ufw?</strong></p>
<p>ufw, or &#8220;uncomplicated firewall&#8221;, is simply a management tool for creating kernel-level firewall rules which is done via the netfilter kernel module and iptables userspace tool.  iptables has been around for quite a long time, is very, very robust and very widely used.  It is installed by default on any Ubuntu system, but no &#8220;rules&#8221; have historically been applied to it.  (Technically, every Linux system has a firewall utility built into the kernel, but if no rules are applied to that filter nothing is actually being specifically allowed or denied.)</p>
<p>The reason ufw was developed (I sat in on the sprint at UDS for this) is that we wanted to create a server-level firewalling utility that was a little bit more &#8220;for human beings&#8221;.  While iptables is already installed and available for use, the syntax can be complicated.  For example, lets say you wanted to block all connections from the IP address 10.100.0.5:</p>
<blockquote><p><code>iptables : sudo iptables -A INPUT -s 10.100.0.5 -j REJECT<br />
ufw: sudo ufw deny from 10.100.0.5<br />
</code></p></blockquote>
<p>Another slightly more complicated example could be written for blocking specific ports and protocols:</p>
<blockquote><p><code>iptables: sudo iptables -A INPUT --dport 22 -s 10.100.0.5 -j REJECT<br />
ufw: sudo ufw deny from 10.100.0.5 to any port 22</code></p></blockquote>
<p>ufw is creating the iptables / netfilter rule &#8220;under the hood&#8221;, but allowing us to create the rules in a simpler way.  Both of the commands above basically do the same thing, ufw simply &#8220;uncomplicates&#8221; the process.</p>
<p>For those that are looking for a GUI on top of ufw, remember that you already have tools such as Firestarter or lokkit, etc.  Those are graphical tools which create and manage iptables / netfilter rules &#8220;under the hood&#8221;.  ufw is simply a command-line tool to manage iptables / netfilter rules &#8220;under the hood&#8221;.</p>
<p>The existing GUI tools (Firestarter) and ufw both use iptables underneath, so adding a GUI to ufw would basically be re-creating Firestarter, which is not really needed.  ufw is simply a less complicated way to create firewall (iptables) &#8220;rules&#8221; on the command line.<br />
<h3>Related</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2008/06/27/presenting-at-oscon-2008-july-21-25-2008/" title="Presenting at OSCON 2008 : July 21-25, 2008">Presenting at OSCON 2008 : July 21-25, 2008</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/05/04/why-ufw-does-not-need-a-gui/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Project Update Announcements</title>
		<link>http://ubuntu-tutorials.com/2008/03/21/project-update-announcements/</link>
		<comments>http://ubuntu-tutorials.com/2008/03/21/project-update-announcements/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 13:59:30 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Folding]]></category>

		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[c0de]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/2008/03/21/project-update-announcements/</guid>
		<description><![CDATA[I wanted to quickly toss something out there for all of you on the interweb.  I spent some time last evening cleaning up a few of my code projects.  If you have been using either of them you may want to update.
apturl for Gnome Do
I spent some time in the #gnome-do channel last nite seeing [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to quickly toss something out there for all of you on the interweb.  I spent some time last evening cleaning up a few of my code projects.  If you have been using either of them you may want to update.</p>
<p><strong>apturl for Gnome Do</strong></p>
<p>I spent some time in the #gnome-do channel last nite seeing what needed to be done for the <a href="https://wiki.ubuntu.com/GnomeDo/Plugins/Apturl" title="apturl for gnome-do plugin">apturl plugin</a> to become better supported.  The end result is that its much cleaner, properly licensed and has been submitted to the do-plugins branch on launchpad for possible future inclusion in the &#8220;official&#8221; plugins package.  If you have been using the apturl plugin for Gnome Do and saw some recent breakage, you can download the new known-to-be-working-on-0.4 version <a href="http://zelut.org/projects/apturl" title="apturl for Gnome-Do">here</a>.</p>
<p><strong>GoogleSecure Greasemonkey Script</strong></p>
<p>I&#8217;m a big fanboy of data encryption, including encrypting as much of my web traffic as I can.  I hacked together a small Greasemonkey script long ago that will force encryption on any supported Google application (gmail, reader, docs, calendar, etc), and recently added Twitter as well.  I guess that might be cause for a name change, but I didn&#8217;t get that far.  I would like to extend the list of sites that it supports, so if you know of any sites that offer https on login but don&#8217;t <em>require</em> (but support) https session-wide, let me know.  If you&#8217;re interested in this tool you can download <a href="https://addons.mozilla.org/en-US/firefox/addon/748" title="Greasemonkey for Firefox">Greasemonkey here</a> and <a href="http://zelut.org/projects/greasey/" title="googlesecure greasemonkey script - force encryption on google tools">GoogleSecure here</a>.</p>
<p><strong>folding.sh</strong></p>
<p>I also have time set aside today to try and squash two remaining bugs in folding.sh.  For all of you great folks that have been using <a href="https://help.ubuntu.com/community/FoldingAtHome/folding.sh" title="folding.sh installation and management tool documentation">folding.sh</a>, expect an update fairly soon.<br />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2007/05/03/enable-basic-keyboard-lighting-on-a-macbook/" title="Enable Basic Keyboard Lighting On a MacBook">Enable Basic Keyboard Lighting On a MacBook</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/12/25/dos-emulation-with-dosbox-get-your-old-school-game-on/" title="DOS Emulation with DOSBox - Get your old-school game on!">DOS Emulation with DOSBox - Get your old-school game on!</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/07/18/removing-kde-icons-in-gnome-remove-gnome-icons-in-kde/" title="Removing KDE icons in gnome / remove gnome icons in KDE">Removing KDE icons in gnome / remove gnome icons in KDE</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/06/04/the-100-best-products-of-the-year/" title="The 100 Best Products of the Year">The 100 Best Products of the Year</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/09/26/how-to-install-vmware-server-on-ubuntu-710/" title="How to Install VMware Server on Ubuntu 7.10">How to Install VMware Server on Ubuntu 7.10</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/04/18/phpmysql-help/" title="PHP/mySQL help">PHP/mySQL help</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/08/01/explorer-destroyer/" title="Explorer Destroyer">Explorer Destroyer</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/07/01/alltray/" title="AllTray">AllTray</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/13/mozilla-firefox-easter-eggs/" title="Mozilla Firefox Easter Eggs">Mozilla Firefox Easter Eggs</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/01/15/the-ubuntu-linux-bible-cd-rom-included/" title="the Ubuntu Linux Bible : CD-ROM Included">the Ubuntu Linux Bible : CD-ROM Included</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/03/21/project-update-announcements/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How To Install SELinux on Ubuntu 8.04 &#8220;Hardy Heron&#8221;</title>
		<link>http://ubuntu-tutorials.com/2008/03/18/how-to-install-selinux-on-ubuntu-804-hardy-heron/</link>
		<comments>http://ubuntu-tutorials.com/2008/03/18/how-to-install-selinux-on-ubuntu-804-hardy-heron/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 15:56:10 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/2008/03/18/how-to-install-selinux-on-ubuntu-804-hardy-heron/</guid>
		<description><![CDATA[I&#8217;m really happy to announce that SELinux is now available in Ubuntu 8.04 &#8220;Hardy Heron&#8221;.  This is the result of the amazing work of the ubuntu-security and ubuntu-hardened teams, as well as the huge contributions from the folks at Tresys.  (note: SELinux will not be the default, but is available as a security option.)
If you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really happy to announce that SELinux is now available in Ubuntu 8.04 &#8220;Hardy Heron&#8221;.  This is the result of the amazing work of the ubuntu-security and ubuntu-hardened teams, as well as the huge contributions from the folks at <a title="Tresys - SELinux security experts" href="http://www.tresys.com/selinux.html">Tresys</a>.  (note: SELinux will not be the default, but is available as a security option.)</p>
<p>If you would prefer to use SELinux over AppArmour, or if you&#8217;re just a good soul that would like to help test Ubuntu&#8217;s SELinux implementation, please read on.</p>
<p><strong>Install SELinux in Ubuntu 8.04</strong></p>
<p>All that is needed is to install the SELinux package, which will remove AppArmour and apply the SELinux policy.</p>
<blockquote><p><code>sudo apt-get install <a title="SELinux security in Ubuntu" href="apt://selinux">selinux</a></code></p></blockquote>
<p>If you run across any issues or bugs please report them against <a title="SELinux ubuntu bug tracker" href="https://bugs.launchpad.net/ubuntu/+source/selinux/">SELinux on launchpad</a>. Welcome to a more secure Ubuntu!<br />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2007/08/03/beagle-simple-questions/" title="Beagle : Simple Questions">Beagle : Simple Questions</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/10/07/sinking-deeper-continued-impressions-of-kubuntu/" title="Sinking Deeper - Continued Impressions of Kubuntu">Sinking Deeper - Continued Impressions of Kubuntu</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/02/23/the-switch-to-kde-day-5/" title="The Switch To KDE : Day 5">The Switch To KDE : Day 5</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/03/10/how-to-choose-the-right-ubuntu-cd/" title="How To Choose The Right Ubuntu CD">How To Choose The Right Ubuntu CD</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/04/28/extended-display-on-the-macbook-with-xorg-conf-ubuntu-804/" title="Extended Display on the MacBook (with xorg.conf) : Ubuntu 8.04">Extended Display on the MacBook (with xorg.conf) : Ubuntu 8.04</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/12/20/folding-06-awesomely-awesome-released/" title="Folding 0.6 &#8220;Awesomely Awesome!&#8221; Released">Folding 0.6 &#8220;Awesomely Awesome!&#8221; Released</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/12/05/how-to-clone-an-installation-ubuntu-510-6061-610/" title="How to clone an installation : Ubuntu (5.10 / 6.06.1 / 6.10)">How to clone an installation : Ubuntu (5.10 / 6.06.1 / 6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/08/16/action-crap-modems-and-dsl/" title="Action-crap modems and DSL&#8230;">Action-crap modems and DSL&#8230;</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/01/27/how-to-find-your-ubuntu-or-kernel-version/" title="How To Find Your Ubuntu or Kernel Version">How To Find Your Ubuntu or Kernel Version</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/10/03/ubuntu-710-gutsy-gibbon-release-countdown/" title="Ubuntu 7.10 &#8220;Gutsy Gibbon&#8221; Release Countdown">Ubuntu 7.10 &#8220;Gutsy Gibbon&#8221; Release Countdown</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/03/18/how-to-install-selinux-on-ubuntu-804-hardy-heron/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Disabling SSH connections on ipv6</title>
		<link>http://ubuntu-tutorials.com/2008/01/12/disabling-ssh-connections-on-ipv6/</link>
		<comments>http://ubuntu-tutorials.com/2008/01/12/disabling-ssh-connections-on-ipv6/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 16:00:30 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/2008/01/12/disabling-ssh-connections-on-ipv6/</guid>
		<description><![CDATA[I was parsing through some of the logs on my new server tonite and I saw some unsuccessful ssh connection on ipv6.  I thought I would mention quickly how you can disable listening on ipv6.
ListenAddress
The /etc/ssh/sshd_config file configures how your ssh daemon should run.  By default it is likely listening on 0.0.0.0 (all [...]]]></description>
			<content:encoded><![CDATA[<p>I was parsing through some of the logs on my new server tonite and I saw some unsuccessful ssh connection on ipv6.  I thought I would mention quickly how you can disable listening on ipv6.</p>
<p><strong>ListenAddress</strong></p>
<p>The <em>/etc/ssh/sshd_config</em> file configures how your ssh daemon should run.  By default it is likely listening on 0.0.0.0 (all ipv4 addresses) and :: (all ipv6), which is defined by two lines:</p>
<blockquote><p><code>#ListenAddress 0.0.0.0<br />
#ListenAddress ::</code></p></blockquote>
<p>To configure your server to *not* listen on ipv6 you can remove that line.  Now it might appear a bit confusing that the line we&#8217;re removing is commented out.  That means its not reading that line, right?  In this case it is displaying one of the default settings.  I have altered my file to only listen on my public facing ipv4 address by removing the &#8220;::&#8221; listing, and specifically defining an ip instead of &#8220;0.0.0.0&#8243;.</p>
<p>Another solution which was brought to my attention by a comment is outlined here:</p>
<blockquote><p><code> AddressFamily any # default<br />
AddressFamily inet # IPv4 only<br />
AddressFamily inet6 # IPv6 only</code></p></blockquote>
<p>By defining the AddressFamily type that we want to use we can listen on both ipv4 and ipv6, just ipv4 or just ipv6.  Find the line above in your config and define the AddressFamily you would prefer to listen on.</p>
<p>Once you update these lines you&#8217;ll need to restart your ssh service.</p>
<blockquote><p><code>sudo /etc/init.d/ssh restart</code></p></blockquote>
<p>Also, as a second measure you can firewall ipv6.  I&#8217;ll be posting a firewall tutorial soon, but the below single command will block all incoming traffic on ipv6:</p>
<blockquote><p><code>sudo ip6tables -P INPUT -j DROP</code></p></blockquote>
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2006/12/01/support-for-5-button-mouse-in-firefox-ubuntu-6061-610/" title="Support for 5-button mouse in Firefox : Ubuntu (6.06.1 / 6.10)">Support for 5-button mouse in Firefox : Ubuntu (6.06.1 / 6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/10/31/kubuntu-till-804/" title="Kubuntu till 8.04&#8230;">Kubuntu till 8.04&#8230;</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/01/27/how-to-find-your-ubuntu-or-kernel-version/" title="How To Find Your Ubuntu or Kernel Version">How To Find Your Ubuntu or Kernel Version</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/11/24/how-to-install-multimedia-codecs-ubuntu-6061-610/" title="How to install multimedia codecs : Ubuntu (6.06.1 / 6.10)">How to install multimedia codecs : Ubuntu (6.06.1 / 6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/02/04/issues-with-launchpad-malone/" title="Issues with Launchpad / Malone">Issues with Launchpad / Malone</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/09/14/aptitude-easter-egg/" title="Aptitude Easter Egg?">Aptitude Easter Egg?</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/10/11/ubuntu-710-gutsy-gibbon-release-candidate-available-suitable-for-testing-by-any-user/" title="Ubuntu 7.10 &#8220;Gutsy Gibbon&#8221; Release Candidate Available - &#8220;Suitable for testing by any user&#8221;">Ubuntu 7.10 &#8220;Gutsy Gibbon&#8221; Release Candidate Available - &#8220;Suitable for testing by any user&#8221;</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/08/31/vim-tip-of-the-week-august-31-2007-remote-editing/" title="Vim Tip of the Week : August 31, 2007 - Remote Editing">Vim Tip of the Week : August 31, 2007 - Remote Editing</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/03/04/how-to-set-evolution-e-mail-to-non-html/" title="How To Set Evolution E-Mail To NON-HTML">How To Set Evolution E-Mail To NON-HTML</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/07/25/dapper-nvidia-compiz-xgl/" title="Ubuntu Dapper Drake nVidia Compiz XGL">Ubuntu Dapper Drake nVidia Compiz XGL</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/01/12/disabling-ssh-connections-on-ipv6/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Looking for information on SELinux in Ubuntu</title>
		<link>http://ubuntu-tutorials.com/2007/09/19/looking-for-information-on-selinux-in-ubuntu/</link>
		<comments>http://ubuntu-tutorials.com/2007/09/19/looking-for-information-on-selinux-in-ubuntu/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 02:21:24 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=446</guid>
		<description><![CDATA[This post is a request for information, tutorials, documentation, etc on using SELinux with Ubuntu or Debian.  I am very interested in deploying it and documenting it (as I tend to do here, of course) but I&#8217;m not finding much information.  If you have:

Been able to deploy it on Ubuntu / Debian
Can refer me to [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a request for information, tutorials, documentation, etc on using SELinux with Ubuntu or Debian.  I am very interested in deploying it and documenting it (as I tend to do here, of course) but I&#8217;m not finding much information.  If you have:</p>
<ol>
<li>Been able to deploy it on Ubuntu / Debian</li>
<li>Can refer me to documentation on doing so</li>
<li>Can give me information on the any status of the possibility</li>
</ol>
<p>please let me know.  I am perfectly aware that Apparmor has been chosen beginning with 7.10 but I would prefer not to use it.  If I&#8217;m going to use one I&#8217;d prefer to use SELinux.  If anyone can point me toward making this work I would very much appreciate it.<br />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2006/11/16/tomboy-050-released-today-deb-package-available-ubuntu-610/" title="Tomboy 0.5.0 Released Today (deb package available) : Ubuntu (6.10)">Tomboy 0.5.0 Released Today (deb package available) : Ubuntu (6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/06/01/vista-top-5/" title="Vista : Top 5!">Vista : Top 5!</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/07/18/windows-genuine-disadvantage-60-million-users-burned/" title="Windows Genuine Disadvantage: 60 million users burned">Windows Genuine Disadvantage: 60 million users burned</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/03/11/how-to-use-jigdo-for-incremental-cd-updates-daily-builds/" title="How To Use Jigdo For Incremental CD Updates (Daily Builds)">How To Use Jigdo For Incremental CD Updates (Daily Builds)</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/11/10/utah-multi-distro-release-party/" title="Utah Multi-Distro Release Party">Utah Multi-Distro Release Party</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/08/21/comcast-is-starting-the-tiered-internet-whether-we-like-it-or-not/" title="Comcast Is Starting The Tiered Internet.. Whether We Like It or Not">Comcast Is Starting The Tiered Internet.. Whether We Like It or Not</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/10/02/how-to-install-vmware-tools-on-ubuntu-guests/" title="How To Install VMware Tools on Ubuntu Guests">How To Install VMware Tools on Ubuntu Guests</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/10/29/codecs-players-games-lamp-fonts-favorites-by-seveas-ubuntu-610/" title="Codecs &#38; Players, Games, LAMP, Fonts &#38; Favorites - by Seveas : Ubuntu (6.10)">Codecs &#38; Players, Games, LAMP, Fonts &#38; Favorites - by Seveas : Ubuntu (6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/11/08/quick-launch-network-connections-and-shares-with-alt-f2/" title="Quick-Launch Network Connections and Shares with ALT-F2">Quick-Launch Network Connections and Shares with ALT-F2</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/05/04/why-ufw-does-not-need-a-gui/" title="Why ufw Does Not Need A GUI">Why ufw Does Not Need A GUI</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2007/09/19/looking-for-information-on-selinux-in-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Network Security with tcpwrappers (hosts.allow and hosts.deny)</title>
		<link>http://ubuntu-tutorials.com/2007/09/02/network-security-with-tcpwrappers-hostsallow-and-hostsdeny/</link>
		<comments>http://ubuntu-tutorials.com/2007/09/02/network-security-with-tcpwrappers-hostsallow-and-hostsdeny/#comments</comments>
		<pubDate>Sun, 02 Sep 2007 17:18:23 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=433</guid>
		<description><![CDATA[I thought today I would outline a few tips on network security with tcpwrappers or, as you&#8217;re probably more familiar, the hosts.allow and hosts.deny files.  How you can use them?  What applications are compatible? etc.  I know network security is a really broad topic, but this will hopefully be enough to get you going and [...]]]></description>
			<content:encoded><![CDATA[<p>I thought today I would outline a few tips on network security with tcpwrappers or, as you&#8217;re probably more familiar, the hosts.allow and hosts.deny files.  How you can use them?  What applications are compatible? etc.  I know network security is a really broad topic, but this will hopefully be enough to get you going and understand some more basics of securing your machine.</p>
<p><strong>tcpwrappers compatibility</strong></p>
<p>The first thing to remember is that not every network-based application on your machine is compatible with tcpwrappers.  The restrictions on hosts.allow or hosts.deny are only valid if they refer to the tcpwrappers library.  How can you find out if your application is compatible?  Use this command:</p>
<blockquote><p><code>ldd /path/to/binary | grep libwrap (general example)</code></p></blockquote>
<blockquote><p><code>ldd /usr/sbin/sshd | grep libwrap (shows that the sshd refers to libwrap)</code></p></blockquote>
<blockquote><p><code>ldd /usr/sbin/apache2 | grep libwrap (show that apache does not refer to libwrap)</code></p></blockquote>
<p>In the basic example above we see that the sshd (ssh server) is referring to the libwrap.so, so we can tell that any restrictions in hosts.allow and hosts.deny are applicable to that service.  We also see that apache2 does not refer to libwrap.so, so any restrictions outlined there do not apply to apache2 connections. (ie; you could lock down ssh but apache2 is still wide open)</p>
<p><strong>hosts.allow and hosts.deny</strong></p>
<p>These two files, located in your /etc/ folder, allow you to limit or permit connections from specific hosts or ips.  Using these two files you could setup a whitelisting firewall or blacklist.  Remember, as mentioned in the compatibility section, this only applies to the services referring to libwrap.  If you are running services outside of the scope of libwrap.so this may not be the best solution for you in terms of firewalling.</p>
<p><strong>/etc/hosts.allow</strong></p>
<p>ALL: 127.0. [::1] (the 127.0. range is allowed, as well as the localhost ipv6 address)</p>
<p>sshd : 192.168.0.5 (specific IP) 192.168.0. (specific range) EXCEPT 192.168.0.10 (range exceptions)</p>
<p><strong>/etc/hosts.deny</strong></p>
<p>ALL : ALL (denying all services to all hosts)</p>
<p>This example would allow connections from localhost on ipv4 and ipv6 for all services and also explicitly allow ssh connections from the 192.168.0.5 address, the entire 192.168.0. range, but excluding the 192.168.0.10 host.  The hosts.deny then outright denies all services for all hosts.  This is a very basic example but hopefully it gets the idea across.  You could also reverse the contents of the two files in the example above and do blacklisting.  ALL : ALL are allowed with the exceptions of services and ips listed in the hosts.deny.</p>
<p>The syntax of the hosts.allow and hosts.deny files are:</p>
<p>service(s) : ips or hosts</p>
<p>You can comma separate the list of services you want to allow or deny and make a similar list of hosts/ips to allow or deny.  Very simple syntax.</p>
<p><strong>conclusion</strong></p>
<p>The hosts.allow and hosts.deny files are very flexible and allow you to lock down your network in very granular ways.  The limitation of some applications not honoring hosts.allow and hosts.deny is the biggest thing to remember.  Make sure the service you are trying to block refers to libwrap.so before you start writing rules or you may sit and wonder why your rules don&#8217;t work, when its really the application itself not being compatible.<br />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2008/06/29/view-a-package-changelog-entry-with-aptitude-or-synaptic/" title="View A Package Changelog Entry With Aptitude or Synaptic">View A Package Changelog Entry With Aptitude or Synaptic</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/12/17/basics-for-the-command-line-for-newbies-ubuntu-510-6061-610/" title="Basics for the command line - for newbies : Ubuntu (5.10 / 6.06.1 / 6.10)">Basics for the command line - for newbies : Ubuntu (5.10 / 6.06.1 / 6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/06/01/vista-top-5/" title="Vista : Top 5!">Vista : Top 5!</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/07/21/im-a-flockstar/" title="I&apos;m a Flockstar!">I&apos;m a Flockstar!</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/02/04/vlc-the-cross-platform-media-player-and-streaming-server/" title="VLC - the cross-platform media player and streaming server">VLC - the cross-platform media player and streaming server</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/11/02/how-to-install-tor-privoxy-kubuntu-606-610/" title="How to install Tor &#38; Privoxy : (K)Ubuntu (6.06 / 6.10)">How to install Tor &#38; Privoxy : (K)Ubuntu (6.06 / 6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/02/09/and-the-winner-is/" title="&#8230;and the winner is">&#8230;and the winner is</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/02/20/twitter-casualty/" title="Twitter Casualty">Twitter Casualty</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/12/23/evolution-gmail-imap-really-slow/" title="Evolution + Gmail IMAP = &#8230;really slow?">Evolution + Gmail IMAP = &#8230;really slow?</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/07/04/tcp-treason-uncloaked/" title="TCP: Treason Uncloaked?">TCP: Treason Uncloaked?</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2007/09/02/network-security-with-tcpwrappers-hostsallow-and-hostsdeny/feed/</wfw:commentRss>
		</item>
		<item>
		<title>7 Steps To An Encrypted Partition (local or removable disk)</title>
		<link>http://ubuntu-tutorials.com/2007/08/17/7-steps-to-an-encrypted-partition-local-or-removable-disk/</link>
		<comments>http://ubuntu-tutorials.com/2007/08/17/7-steps-to-an-encrypted-partition-local-or-removable-disk/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 02:10:49 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=418</guid>
		<description><![CDATA[Update : Encypted root file system option now available at installation in Ubuntu 7.10.  See Install Time Ubuntu Encryption for more information.
This last week I&#8217;ve been very interested in encryption.  If you missed it you might be interested in my post on encrypting files or emails with GPG.  In this tutorial I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>Update : Encypted root file system option now available at installation in Ubuntu 7.10.  See <a href="http://ubuntu-tutorials.com/2007/10/09/ubuntu-710-gutsy-supporting-install-time-encryption/" title="installation based root file system encryption">Install Time Ubuntu Encryption</a> for more information.</p>
<p>This last week I&#8217;ve been very interested in encryption.  If you missed it you might be interested in my post on <a href="http://ubuntu-tutorials.com/2007/08/14/privacy-and-encryption-with-pgp-signing-and-encrypting-email-files/" title="encrypting files with PGP private key encryption">encrypting files or emails with GPG</a>.  In this tutorial I wanted to outline how to encrypt a local partition or a removable device (like a USB key).  The steps used here will work for either type of device although you&#8217;ll need to replace your partition name and number for the examples provided here.</p>
<p><strong>Attention: following this tutorial will wipe all data from the partition or device you write it to.  You cannot encrypt your file system after-the-fact using this method.  Be sure you have backups or don&#8217;t care about the data being lost if you follow these steps!!!</strong></p>
<p><strong>Step 1:</strong></p>
<p>The first step in the tutorial is installing the cryptsetup utility, which is part of the cryptsetup package.  You can search for this using your favorite package management utility or use this command:</p>
<blockquote><p><code>sudo aptitude install cryptsetup</code></p></blockquote>
<p><strong>Step 2:</strong></p>
<p>Now that we have the cryptsetup utility installed we&#8217;ll need to prepare the device for use.  If you have a newly created device or partition you may be able to skip this step, but it also won&#8217;t hurt to redo this step anyway.</p>
<p>If you are unsure what the device is listed as, you can use either of these two commands:</p>
<blockquote><p><code>sudo fdisk -l</p>
<p><em>(this will list your current partition table, both on local and removable media.)</em></code></p></blockquote>
<blockquote><p><code>dmesg</p>
<p><em>(this will show kernel messages pertaining to hardware.  If you plug in a removable device and wait a few seconds, this will show what you what device the kernel assigned the hardware.)</em></code></p></blockquote>
<p>Once you know what device you want to apply this to you can run the following command on [your device] to create the partition you want to encrypt.  I suppose you can also use a graphical utility like gparted, etc.  Those tools are outside the scope of this tutorial.</p>
<blockquote><p><code>sudo fdisk /dev/[your device]</p>
<p><em>(ie; if your device showed up as /dev/sdb you would use: sudo fdisk /dev/sdb)</em></code></p></blockquote>
<p>For removable media make a single primary partition using the entire space of the device (or alter for your needs if you know what you&#8217;re doing).</p>
<p>Once you have created the partition you&#8217;ll want to &#8220;w&#8221;rite the change in fdisk.  Remember, if you don&#8217;t &#8220;w&#8221;rite the changes none will be applied.</p>
<p><strong>Step 3:</strong></p>
<p>To make sure that your kernel is up to date concerning the newly created / altered partition table you may need to run the command:</p>
<blockquote><p><code>sudo partprobe</code></p></blockquote>
<p><strong>Step 4:</strong></p>
<p>Now we&#8217;ll get to encrypting this new partition.  There are different options you can use here, and I&#8217;ll outline a few of them, but there really isn&#8217;t one that is &#8220;the best&#8221;.  It depends on your level of security needs and the time you want to spend on it.  If you want it done quickly and want a basic level of fairly-hard-to-break encryption you can use the first option.  If you are super paranoid and don&#8217;t mind letting this take some time (hours or days on large disks!) to build you can use option three.  Somewhere in the middle, option two is probably fine.  Anyone have suggestions on other methods?</p>
<p>We&#8217;ll write data over the newly created partition to help aid in the encryption process.  By writing data to the partition prior to encryption it helps protect against data attacks, finding patterns on the block-level, etc.  You can use one of the following three commands:</p>
<blockquote><p><code>sudo dd if=/dev/zero of=/dev/[your device] bs=4K</p>
<p><em>(this method is probably recommended unless you expect active attacks against your encryption layer)</em></code></p></blockquote>
<blockquote><p><code>sudo badblocks -vfw /dev/[your device] [block-size-of-your-device]</p>
<p><em>(this option will write 5 data patterns across your drive and overwrite and verify the data.  This is used to check for badblocks, but can also be used to wipe out any existing data)</em></p>
<p>sudo dd if=/dev/urandom of=/dev/[your device] bs=4K</p>
<p><em>(this method is considered pretty secure.  It is based on the truly random option below but is pseudo-random data&#8211;probably a very good option in most cases.)</em></code></p></blockquote>
<blockquote><p><code>sudo dd if=/dev/random of=/dev/[your device] bs=4K</p>
<p><em>(this is considered the most secure but will take a long time.  <strong>It is also important to generate a lot of random data on your machine.  Launch some applications, do some high disc I/O, move the mouse erratically, etc. This may take DAYS!</strong>)</em></code></p></blockquote>
<p><strong>Step 5:</strong></p>
<p>At this point the partition is ready to be encrypted.  Now there are multiple encryption methods and options to be used within each.  This tutorial outlines using the LUKS encryption with my prefered string length, hash and cipher.  You may change these if you know what you&#8217;re doing.  If not, omitting my options will use the defaults (ripemd160 hash).  This command will remind you that all data will be lost (although we already lost everything in Step 4.  This is also where you&#8217;ll be prompted for your passphrase to access the encryption.</p>
<blockquote><p><code>sudo cryptsetup luksFormat /dev/[your device] -c aes -s 256 -h sha256</p>
<p><em>(again, past [your device] are my preferred options)</em></code></p></blockquote>
<p>If you see an error near this point similar to &#8220;Failed to setup dm-crypt key mapping.  Check kernel for support for the aes-cbc-plain cipher spec and verify that /dev/[your device] contains at least 258 sectors.&#8221; you&#8217;ll need to run this command:</p>
<blockquote><p><code>sudo modprobe dm-crypt</code></p></blockquote>
<p>You may want to have this module auto-magically added at boot time by appending this line to your /etc/modules file:</p>
<blockquote><p><code>dm-crypt</code></p></blockquote>
<p><strong>Step 6:</strong></p>
<p>Now that we&#8217;ve created the encryption basic layout on the partition we need to open the encrypted partition for use.</p>
<blockquote><p><code>sudo cryptsetup luksOpen /dev/[your device] <em>name</em></p>
<p><em>(name can be whatever you like.  I use things like secure or vault or encrypt)</em></code></p></blockquote>
<p><strong>Step 7:</strong></p>
<p>Now that we have the device open and added to the dm (dev mapper) system we can actually create a file system on it and use it.  One last command and we&#8217;ve got ourselves an encrypted, usable filesystem.</p>
<blockquote><p><code>sudo mke2fs -j /dev/mapper/<em>name</em> -L <em>label</em></p>
<p><em>(where </em><em>name was applied above and </em><em>label is the filesystem label.  I generally match the two.  This also assumes an ext3 file system.  If you know you want a different filesystem type I&#8217;m assuming you know the right command.)</em></code></p></blockquote>
<p>If you&#8217;ve come this far your device is ready to use.  A few additional points that you may be interested in.</p>
<p><strong>Additional</strong></p>
<p>First, if this is a local partition and filesystem, such as a /data folder, you may want it to be mounted automagically at boot time.  You can add the new partition to your <strong>/etc/fstab</strong> file to be mounted at boot.  Be sure to specify the <strong>/dev/mapper/[name]</strong> location and not the original partition location.  You should note that when your booting system arrives at this device it will prompt you for a passphrase key and halt the boot process until one is provided.  An example of a line in the /etc/fstab is:</p>
<blockquote><p><code>/dev/mapper/name     /data     ext3     defaults     0  0</code></p></blockquote>
<p>Second, if you are using this on a removable drive such as a usb key the Gnome Desktop (someone verify in KDE?) will recognize the encrypted setup and prompt you for a key visually. A message such as &#8220;The storage device contains encrypted data.  Enter a password to unlock&#8221; will appear.  You will be required to know the passphrase (as supplied in Step 5) to access this device again.  The desktop system also allows you to &#8220;<em>forget immediately</em>&#8220;, &#8220;<em>remember password until you logout</em>&#8221; or &#8220;<em>remember forever</em>&#8221; the key provided.  Those options are up to you and your usage.  &#8220;<em>Remember forever</em>&#8221; should store the key in your gnome keyring.</p>
<p>Third, if you are following this guide for use on a removable disk you may want to change ownership (chown) on the mounted path and set group id (sgid) on the directory so that your user has full permissions.  Considering we ran everything with sudo the mounted path and ownership is probably set to the root user.  You can use these two commands to set the permissions:</p>
<blockquote><p><code>sudo chown -R user.user /media/[name]</p>
<p><em>(user.user should, of course, be replaced with your username on the system)</em></code></p></blockquote>
<blockquote><p><code>sudo chmod g+s /media/[name]</p>
<p><em>([name] is the mount point that the system auto-mounted the device on.  It *should* match whatever you set the label to in step 7.)</em></code></p></blockquote>
<p>There is also an option to create multiple keys to unlock the device.  This is helpful if it is a multi-user system and you don&#8217;t want to use a shared passphrase.  You would add a key to the encrypted device using:</p>
<blockquote><p><code>sudo cryptsetup luksAddKey /dev/[your device]</code></p></blockquote>
<p>This will prompt you for your current key and then the new key.  The new key will have to be entered twice.  Also, if you want to remove a key you can use the similar:</p>
<blockquote><p><code>sudo cryptsetup luksDelKey /dev/[your device] [slot #]</code></p></blockquote>
<p>To find out more information about your encrypted partition / device, and to see things such as assigned key slots, you can also use:</p>
<blockquote><p><code>sudo cryptsetup status <em>name</em></code></p></blockquote>
<blockquote><p><code>sudo cryptsetup luksDump /dev/[your device]</code></p></blockquote>
<p>I would like to expand this soon to include encrypting your entire root filesystem or other variations like bypassing the passphrase but storing the &#8220;key&#8221; an a usb drive or similar.  This way it is similar to a hardware key needed to boot your machine.  There are a lot of different ways this could go&#8230; until then, I think this has become long enough <img src='http://ubuntu-tutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<hints id="hah_hints"></hints><br />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://ubuntu-tutorials.com/2007/05/01/how-to-pwn-your-text-files-with-vim/" title="How To pwn Your Text Files With Vim">How To pwn Your Text Files With Vim</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/29/view-a-package-changelog-entry-with-aptitude-or-synaptic/" title="View A Package Changelog Entry With Aptitude or Synaptic">View A Package Changelog Entry With Aptitude or Synaptic</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/02/17/looking-for-a-few-passionate-volunteers-ubuntu-community-participation-project/" title="Looking For a Few Passionate Volunteers - Ubuntu Community Participation Project">Looking For a Few Passionate Volunteers - Ubuntu Community Participation Project</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/08/15/vhcs-v2471-pro-do-not-use/" title="VHCS v2.4.7.1 Pro - DO NOT USE">VHCS v2.4.7.1 Pro - DO NOT USE</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/07/24/verizon-treads-into-the-realm-of-the-prince/" title="Verizon treads into the realm of The Prince">Verizon treads into the realm of The Prince</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/06/13/ubuntu-tutorials-poll-what-would-you-like-to-see/" title="Ubuntu Tutorials Poll: What Would You Like To See?">Ubuntu Tutorials Poll: What Would You Like To See?</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/06/30/ie-a-whole-new-internet/" title="IE: A whole new internet">IE: A whole new internet</a></li>
<li><a href="http://ubuntu-tutorials.com/2006/12/29/right-click-to-launch-custom-scripts-with-nautilus-ubuntu-6061-610/" title="Right-Click to Launch Custom Scripts with Nautilus : Ubuntu (6.06.1 / 6.10)">Right-Click to Launch Custom Scripts with Nautilus : Ubuntu (6.06.1 / 6.10)</a></li>
<li><a href="http://ubuntu-tutorials.com/2007/12/19/xo-laptop-specs-for-those-interested/" title="XO Laptop Specs.. for those interested">XO Laptop Specs.. for those interested</a></li>
<li><a href="http://ubuntu-tutorials.com/2008/07/03/printi-directly-to-pdf-in-ubuntu-804/" title="Print Directly To PDF in Ubuntu 8.04">Print Directly To PDF in Ubuntu 8.04</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2007/08/17/7-steps-to-an-encrypted-partition-local-or-removable-disk/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
