<?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>Ubuntu How To</title>
	<atom:link href="http://ubuntuhowto.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://ubuntuhowto.org</link>
	<description>Ubuntu How To Guides and Tutorials</description>
	<lastBuildDate>Sat, 10 Sep 2011 22:16:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>New Gadget Blog Launched UberGadget.net</title>
		<link>http://ubuntuhowto.org/new-gadget-blog-launched-ubergadget-net/</link>
		<comments>http://ubuntuhowto.org/new-gadget-blog-launched-ubergadget-net/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 22:16:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Gadget]]></category>

		<guid isPermaLink="false">http://ubuntuhowto.org/?p=103</guid>
		<description><![CDATA[New site launched about Gadget News &#38; Reviews go check it out ! I decided against posting News &#38; Reviews here, iPhone HowTo will remain for iPhone HowTo guides only]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ubergadget.net"><img class="aligncenter size-full wp-image-104" title="Gadget News &amp; Reviews UberGadget" src="http://ubuntuhowto.org/wp-content/uploads/2011/09/UberGadget.net_.png" alt="Gadget News &amp; Reviews UberGadget" width="580" height="517" /></a></p>
<p>New site launched about <a title="Gadget News &amp; Reviews" href="http://ubergadget.net">Gadget News &amp; Reviews</a> go check it out ! I decided against posting News &amp; Reviews here, iPhone HowTo will remain for iPhone HowTo guides only <img src='http://ubuntuhowto.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntuhowto.org/new-gadget-blog-launched-ubergadget-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Ubuntu in VMWare Player</title>
		<link>http://ubuntuhowto.org/install-ubuntu-in-vmware-player/</link>
		<comments>http://ubuntuhowto.org/install-ubuntu-in-vmware-player/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 15:10:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Top Posts]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Natty Narwhal]]></category>
		<category><![CDATA[Ubuntu 11.04]]></category>
		<category><![CDATA[VMWare Player]]></category>

		<guid isPermaLink="false">http://ubuntuhowto.org/?p=34</guid>
		<description><![CDATA[How to install Ubuntu 11.04 in VMWare Player using EasyInstall This is a step by step guide showing you how to install Ubuntu 11.04 Desktop on VMWare workstation running on a Windows 7 Host, running an IT Support company in Bristol we find that being able to run Ubuntu on top of Windows 7 very [...]]]></description>
			<content:encoded><![CDATA[<h1>How to install Ubuntu 11.04 in VMWare Player using EasyInstall</h1>
<p>This is a step by step guide showing you how to install Ubuntu 11.04 Desktop on VMWare workstation running on a Windows 7 Host, running an <strong><a title="IT Support in Bristol" href="http://www.netzensolutions.com/it-support/locations/bristol">IT Support company in Bristol</a></strong> we find that being able to run Ubuntu on top of Windows 7 very handy for building &amp; testing new Ubuntu virtual servers.</p>
<h3>Download Ubuntu Desktop</h3>
<p>Download Ubuntu from <a href="http://www.ubuntu.com/download">http://www.ubuntu.com/download</a> make sure you download the right version and the correct architecture (i686 / AMD64).</p>
<h3>Create a new Virtual Machine in VMWare Player</h3>
<p>Open VMWare Player and select &#8220;Create New Virtual Machine&#8221;.</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/create-new-virtual-machine-vmware-player.png"><img class="alignleft size-medium wp-image-37" title="create-new-virtual-machine-vmware-player" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/create-new-virtual-machine-vmware-player-300x255.png" alt="" width="300" height="255" /></a></p>
<p><span id="more-34"></span></p>
<h3>New Virtual Machine Wizard</h3>
<p>Enter in the location of the ISO you downloaded above and click next.</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/new-virtual-machine-wizard-ubuntu-iso.png"><img class="alignleft size-medium wp-image-40" title="new-virtual-machine-wizard-ubuntu-iso" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/new-virtual-machine-wizard-ubuntu-iso-300x272.png" alt="" width="300" height="272" /></a></p>
<h3>VMWare EasyInstall for Ubuntu</h3>
<p>Enter in the Ubuntu information, the information requested is used for the Ubuntu install, so this will be the username and password you will eventually use to log into your Ubuntu system.</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-easy-install-information.png"><img class="alignleft size-medium wp-image-46" title="vmware-easy-install-information" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-easy-install-information-300x272.png" alt="" width="300" height="272" /></a></p>
<h3>Name the Ubuntu Virtual Machine</h3>
<p>Enter the virtual machine name and the location you want to install the Ubuntu virtual machine.</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/name-the-virtual-machine.png"><img class="alignleft size-medium wp-image-39" title="name-the-virtual-machine" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/name-the-virtual-machine-300x272.png" alt="" width="300" height="272" /></a></p>
<h3>Enter Hard drive Size</h3>
<p>Enter the size you want your Ubuntu VM to be, I selected 20Gb as this virtual machine is just for testing. I never split my VM disk files either, I have had problems with this in the past.</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/specify-disk-capacity.png"><img class="alignleft size-medium wp-image-41" title="specify-disk-capacity" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/specify-disk-capacity-300x272.png" alt="" width="300" height="272" /></a></p>
<h3>Create Ubuntu Virtual Machine</h3>
<p>Verify your VM settings and click Finnish.</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/create-virtual-machine.png"><img class="alignleft size-medium wp-image-38" title="create-virtual-machine" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/create-virtual-machine-300x272.png" alt="" width="300" height="272" /></a></p>
<h3>Ubuntu install screen</h3>
<p>You should now be presented with the following Ubuntu 11.04 (Natty Narwhal) installation screens, telling you all about Ubuntu&#8217;s new and exciting features&#8230;</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/ubuntu-11.04-install-screen.png"><img class="alignleft size-medium wp-image-42" title="ubuntu-11.04-install-screen" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/ubuntu-11.04-install-screen-300x239.png" alt="" width="300" height="239" /></a></p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/ubuntu-11.04-install-screen-features.png"><img class="alignleft size-medium wp-image-43" title="ubuntu-11.04-install-screen-features" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/ubuntu-11.04-install-screen-features-300x239.png" alt="" width="300" height="239" /></a></p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/ubuntu-11.04-install-screen-features-2.png"><img class="alignleft size-medium wp-image-44" title="ubuntu-11.04-install-screen-features-2" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/ubuntu-11.04-install-screen-features-2-300x239.png" alt="" width="300" height="239" /></a></p>
<h3>VMWare tools login for EasyInstall</h3>
<p>You may see this screen:</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-tools-login-easy-install.png"><img class="alignleft size-medium wp-image-49" title="vmware-tools-login-easy-install" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-tools-login-easy-install-300x248.png" alt="" width="300" height="248" /></a></p>
<h3>Ubuntu Login Screen</h3>
<p>I went for a coffee with this screen showing, came back and I was at the login screen&#8230; Which looks like this.<br />
<a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-player-ubuntu-login-screen.png"><img class="alignleft size-medium wp-image-48" title="vmware-player-ubuntu-login-screen" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-player-ubuntu-login-screen-300x239.png" alt="" width="300" height="239" /></a></p>
<h3>Ubuntu Desktop</h3>
<p>Login and your desktop should look like this!<br />
<a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-player-ubuntu-desktop.png"><img class="alignleft size-medium wp-image-47" title="vmware-player-ubuntu-desktop" src="http://ubuntuhowto.org/wp-content/uploads/2011/07/vmware-player-ubuntu-desktop-300x239.png" alt="" width="300" height="239" /></a></p>
<h3>Ubuntu Install Finished</h3>
<p>That&#8217;s basically it, go forth and login to your new Ubuntu 11.04 vitalized desktop environment! Once installed I would recommend checking for updates using aptitude.</p>
<p>Any problems or questions please post a comment below and I will get back to you ASAP.</p>
<p>Please share using the icons above and below the post <img src='http://ubuntuhowto.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntuhowto.org/install-ubuntu-in-vmware-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Login as root</title>
		<link>http://ubuntuhowto.org/login-as-root/</link>
		<comments>http://ubuntuhowto.org/login-as-root/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 17:45:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Top Posts]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[Ubuntu Desktop]]></category>
		<category><![CDATA[Ubuntu Server]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://ubuntuhowto.org/?p=92</guid>
		<description><![CDATA[Ubuntu Root By default the root account on Ubuntu is disabled, you can login as root on Ubuntu or even enable root account on Ubuntu. I will explain below how to run commands as root and how to enable the root user on Ubuntu. Run commands using sudo You can run root commands with root [...]]]></description>
			<content:encoded><![CDATA[<h1>Ubuntu Root</h1>
<p>By default the root account on Ubuntu is disabled, you can login as root on Ubuntu or even enable root account on Ubuntu. I will explain below how to run commands as root and how to enable the root user on Ubuntu. </p>
<h3>Run commands using sudo</h3>
<p>You can run root commands with root privileges by prefixing your commands with &#8220;sudo&#8221;. The example below shows you how to add a user using sudo. </p>
<pre>
sudo useradd dave
</pre>
<p>You will then be prompted to enter your password, enter the password for your user account (the same password you use to login to your ubuntu system). </p>
<p>Here is what your terminal output should look like. </p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/sudo-useradd-ubuntu.png"><img src="http://ubuntuhowto.org/wp-content/uploads/2011/07/sudo-useradd-ubuntu.png" alt="" title="sudo Ubuntu useradd" width="580" height="300" class="alignleft size-full wp-image-93" /></a></p>
<p><span id="more-92"></span></p>
<h3>Stay logged in as root using sudo</h3>
<p>If you are going to be doing a lot of work as root or find some commands won&#8217;t work with sudo then you can stay permanently logged in as root on Ubuntu using: </p>
<pre>
sudo -s
</pre>
<p>You will then be prompted for your password as before, then your prompt will change to root@hostname. (example below). </p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/sudo-s-ubuntu.png"><img src="http://ubuntuhowto.org/wp-content/uploads/2011/07/sudo-s-ubuntu.png" alt="" title="sudo -s Ubuntu" width="580" height="300" class="alignleft size-full wp-image-95" /></a></p>
<p>sudo and sudo -s have covered me for every eventuality for getting root on Ubuntu, however if you need to enable the root user on ubuntu read on&#8230; </p>
<h3>Enable root on Ubuntu</h3>
<p>Enabling the root account on Ubuntu is as simple as setting the password for the account.</p>
<pre>
sudo passwd root
</pre>
<p>You will be prompted for a password enter your user account password first to authenticate for sudo, then enter your root password.</p>
<p>You will now be able to login as root on Ubuntu! </p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/enable-root-user-ubuntu.png"><img src="http://ubuntuhowto.org/wp-content/uploads/2011/07/enable-root-user-ubuntu.png" alt="" title="Enable root user Ubuntu" width="580" height="300" class="alignleft size-full wp-image-96" /></a></p>
<p>If you wish to disable the root account on Ubuntu enter the following:</p>
<pre>
sudo passwd -l root
</pre>
<p>Thats it! Comments welcome and please share using the buttons provided!</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntuhowto.org/login-as-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Firefox 5 Ubuntu 11.04</title>
		<link>http://ubuntuhowto.org/install-firefox-5/</link>
		<comments>http://ubuntuhowto.org/install-firefox-5/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 19:18:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Top Posts]]></category>
		<category><![CDATA[Firefox 5]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Natty Narwhal]]></category>
		<category><![CDATA[Ubuntu 11.04]]></category>

		<guid isPermaLink="false">http://ubuntuhowto.org/?p=22</guid>
		<description><![CDATA[Installing Firefox 5 is now part of the Official Ubuntu 11.04 repository so installing Firefox 5 on Ubuntu is as simple as updating your system. apt-get update &#038;&#038; apt-get dist-upgrade Once this has completed reopen Firefox and you should see a small migration wizard pop up for a second or two, after this click &#8220;Help&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Firefox 5 is now part of the Official Ubuntu 11.04 repository so installing Firefox 5 on Ubuntu is as simple as updating your system.</p>
<pre>
apt-get update &#038;&#038; apt-get dist-upgrade
</pre>
<p>Once this has completed reopen Firefox and you should see a small migration wizard pop up for a second or two, after this click &#8220;Help&#8221; then &#8220;About Firefox&#8221; you should then be presented with the following:</p>
<p><a href="http://ubuntuhowto.org/wp-content/uploads/2011/07/firefox-5-ubuntu.png"><img src="http://ubuntuhowto.org/wp-content/uploads/2011/07/firefox-5-ubuntu-300x188.png" alt="" title="Help About Firefox 5" width="300" height="188" class="alignleft size-medium wp-image-67" /></a></p>
<p>Any problems or questions please post a comment below and I will get back to you ASAP.</p>
<p>Please share using the icons above and below the post <img src='http://ubuntuhowto.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntuhowto.org/install-firefox-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure SSH</title>
		<link>http://ubuntuhowto.org/secure-ssh/</link>
		<comments>http://ubuntuhowto.org/secure-ssh/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 11:14:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Top Posts]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LTS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Ubuntu Server]]></category>

		<guid isPermaLink="false">http://ubuntuhowto.org/?p=9</guid>
		<description><![CDATA[This guide explains how to secure your SSH Server on Ubuntu to help prevent unauthorised users (hackers) accessing your server. You should already have an SSH Server installed and running if you don’t install one now with: apt-get install ssh Now before I start you maybe wondering “Who would want to break into my SSH [...]]]></description>
			<content:encoded><![CDATA[<p>This guide explains how to secure your SSH Server on Ubuntu to help prevent unauthorised users (hackers) accessing your server.</p>
<p>You should already have an SSH Server installed and running if you don’t install one now with:</p>
<pre>
apt-get install ssh
</pre>
<p>Now before I start you maybe wondering “Who would want to break into my SSH Server?” the answer is more than likely a Bot. Bot’s scan subnets of boxes with high bandwidth or those on government ranges (to look cool on IRC when then have a reverse DNS with something like nasa.gov or .mod). Once the Bot has compromised your machine it is added to a large network of other compromised computers which is controlled by the “Hacker”, the machines are then “normally” used to DDOS other sites offline, if you can Imagen the power of say 1000 hacked servers with 100 Mbp connections to the internet bombarding TCP connections at another server on the Internet, the result is downtime. The web server is overloaded with requests and the server is rendered useless causing you frustration, money, time, pain and a possible sacking. So bottom line secure your SSH Server and any other services for that matter and make sure you keep your servers up to date!</p>
<p><span id="more-9"></span></p>
<h3>Scare tactics</h3>
<p>Still not convinced? You might be interested in seeing if your SSH Server has been attacked by crackers / hackers:</p>
<p>Use lastdb to quickly see last login attempts:</p>
<pre>
lastb
</pre>
<p>To see the top 5 most attacked accounts:</p>
<pre>
lastb | awk '{print $1}' | sort | uniq -c | sort -rn | head -5
</pre>
<p>Top 5 Attacker IP Addresses:</p>
<pre>
awk 'gsub(".*sshd.*Failed password for (invalid user )?", "") {print $3}' /var/log/secure* | sort | uniq -c | sort -rn | head -5
</pre>
<h3>Securing SSH Server on Ubuntu</h3>
<p>Ok So now your worried about the amount of attack attempts on your server here is the guide.</p>
<p>Secure passwords, simple don’t have weak passwords on your server, don’t base them on dictionary words, do use number and a combo of upper and lower case letters. I personally don’t like special characters in passwords as they have been known to cause problems…<br />
Install “DenyHosts” amazing program that watches the /var/log/secure logfile for invalid ssh login attempts, and if a configurable threshold is crossed, they are automatically blocked by being added to /etc/hosts.deny. Install denyhosts, and optionally edit the good default configuration in /etc/denyhosts.conf, you might want to allow certain local users a higher incorrect password limit before blocking, I have had some problems with this in the past, I won’t name names, you know who you are! To install DenyHosts:<br />
apt-get install denyhosts<br />
Change the SSH port, security by obscurity, but it defiantly works my web servers were getting blasted with attackers on port 22. To change the port edit: /etc/ssh/ssh_config and edit the line<br />
&#8220;Port 22&#8243;<br />
to something else, i wouldn’t use 2222 as everyone else picks that port! (creative sysadmins?)<br />
Allow only SSH Protocol 2 open “/etc/ssh/ssh_config” and change the following:<br />
#Protocol 2,1<br />
Protocol 2<br />
Disable root logins, edit ssh_config:<br />
PermitRootLogin no<br />
Limit the maximum number of unauthenticated connections that the ssh server will handle at the same time. The smaller this is, the harder it is for script kiddies to make parallel, coordinated cracking attempts with multiple connections. edit sshd_config and change MaxStartups from the default of “10″ to “3:50:10″. The colon separated values tells the ssh server to, “allow 3 users to attempt logging in at the same time, and to randomly and increasingly drop connection attempts between 3 and the maximum of 10″. Note: this should be increased on servers with substantial numbers of valid ssh users logging in.</p>
<pre>
#MaxStartups 10
MaxStartups 3:50:10
</pre>
<p>Reduce the maximum amount of time allowed to successfully login before disconnecting. The default is 2mins I change my servers to 20 seconds, who takes 2 mins to login?</p>
<pre>
#LoginGraceTime 2m
LoginGraceTime 30
</pre>
<p>Allow only specific users to login, if you only want Stan, Kenny,Cartman and all user names starting with “mr” to login:</p>
<pre>
AllowUsers stan, kenny, cartman, mr*
</pre>
<p>You can do the same with groups, make a “sshusers” group and add your ssh users to it, then edit the ssh_config:</p>
<pre>
AllowGroups sshusers
</pre>
<p>Allow only users from certain IP addresses to connect. Before allowing specific IPs, the default policy must first be set to DENY to be effective. edit /etc/hosts.deny and add the following line:<br />
sshd: ALL Next add to /etc/hosts.allow the networks you want to allow. For example, to allow all 254 hosts on the class C network &#8220;192.168.1.*&#8221;, all 16million hosts from the class A network &#8220;10.0.0.0&#8243;, and the lonely IP 24.42.69.101, you would add the following to /etc/hosts.allow: </p>
<pre> sshd: 192.168.1.0/255.255.255.0
sshd: 10.0.0.0/255.0.0.0
sshd: 24.42.69.101
</pre>
<p>Use keys instead of password auth, this will completely stop password crackers!</p>
<pre>
PasswordAuthentication no
</pre>
<p>By default SSH listens on all IP&#8217;s if you only need it on 1 IP:</p>
<pre>
ListenAddress 10.0.1.50
</pre>
<p>Please share using the links below, and above the post! Feel free to drop me a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntuhowto.org/secure-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rsnapshot on Ubuntu</title>
		<link>http://ubuntuhowto.org/rsnapshot-on-ubuntu/</link>
		<comments>http://ubuntuhowto.org/rsnapshot-on-ubuntu/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 21:30:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Top Posts]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://ubuntuhowto.org/?p=6</guid>
		<description><![CDATA[have the job of planning the backup solution for our Ubuntu Linux servers the system needs to meet the following requirements: Secure &#8211; Data must be transfered securely using encryption Automated &#8211; Must run each day without any user interaction Reliable &#8211; Must be reliable for obvious reasons! Email reports &#8211; I only want to [...]]]></description>
			<content:encoded><![CDATA[<p>have the job of planning the backup solution for our Ubuntu Linux servers the system needs to meet the following requirements:</p>
<ul>
<li>Secure &#8211; Data must be transfered securely using encryption</li>
<li>Automated &#8211; Must run each day without any user interaction</li>
<li>Reliable &#8211; Must be reliable for obvious reasons!</li>
<li>Email reports &#8211; I only want to hear if the backup has failed, I do not want an email every day saying the backup was successful! (I get enough mail already!).</li>
</ul>
<p><span id="more-6"></span><br />
With the above information, I took to the web and did many hours of research and decide on using rsnapshot, it basically works like Apple Time Machine, but on the command line, syncing only what has changed each day and creating snapshots via hard links.</p>
<p>Another advantage of rsnapshot is that it logs into remote servers and pulls the data back over SSH, which means the backup server can sit behind a firewall with no ports forwarded in, this is very important as the server is going to be authenticating to other servers via ssh keys without passphrases.</p>
<p>For more info check out <a title="Rsnapshot dot org" href="http://www.rsnapshot.org">http://www.rsnapshot.org</a></p>
<h3>Installing Rsnapshot on Ubuntu</h3>
<p>Login as root (or sudo -s)</p>
<pre>aptitude install rsnapshot</pre>
<p>This will install Rsnapshot and pull down any packages it depends on.<br />
Open up the file &#8220;/etc/rsnapshot.conf&#8221; with you&#8217;re chosen text editor (I use vi), lets take a look at the first section &#8220;snapshot_root&#8221; this is the location where Rsnapshot stores it&#8217;s backups. By default it places them in the root directory, but I have changed mine to &#8220;/backup/snapshots/&#8221;.</p>
<pre># All snapshots will be stored under this root directory.
#
snapshot_root   /backup/snapshots/</pre>
<p>Next I uncommented &#8220;no_create_root 1&#8243; this stops rsnapshot creating the snapshot_root dir, (meaning you have to create it yourself). The benefit of this being, if your backing up to a USB drive and you forget to connect it rsnapshot will not backup to the mount point filling your drive space up and possibly causing a server crash (if you have partitioned incorrectly).</p>
<pre># If no_create_root is enabled, rsnapshot will not automatically create the
# snapshot_root directory. This is particularly useful if you are backing
# up to removable media, such as a FireWire or USB drive.
#
no_create_root  1</pre>
<p>We are using Linux, so uncomment the &#8220;cmd_cp&#8221; line.</p>
<pre># LINUX USERS:   Be sure to uncomment "cmd_cp". This gives you extra features.
# EVERYONE ELSE: Leave "cmd_cp" commented out for compatibility.
#
# See the README file or the man page for more details.
#
cmd_cp          /bin/cp</pre>
<p>Next uncomment &#8220;cmd_ssh&#8221; and give it the correct path to the ssh binary.</p>
<pre># Uncomment this to enable remote ssh backups over rsync.
#
cmd_ssh        /usr/bin/ssh</pre>
<p>I uncommented the du option as well, cool little tool that shows you the size of each of your snapshots. (remember if you just did a &#8220;du -sh *&#8221; in the snapshot dir it would read wrong due to the hard linking).</p>
<pre># Uncomment this to specify the path to "du" for disk usage checks.
# If you have an older version of "du", you may also want to check the
# "du_args" parameter below.
#
cmd_du          /usr/bin/du</pre>
<p>This brings us onto Backup Intervals, as you can see I have kept the defaults, so rsnapshot will keep 6 copies of my hourly backup before it starts over writing my old one, 7 copies of my daily backups, 4 of my weekly and 3 monthly backups! Worth noting that rsnapshot will not create the daily.0 backup until hourly.5 has been created in the snapshot_root, the same with weekly and monthly.</p>
<pre>#########################################
#           BACKUP INTERVALS            #
# Must be unique and in ascending order #
# i.e. hourly, daily, weekly, etc.      #
#########################################

interval        hourly  6
interval        daily   7
interval        weekly  4
interval        monthly 3</pre>
<p>Global Options</p>
<p>The defaults for these are normally fine, however I wanted to a bit more verbosity until I am happy the backup system is working. I changed the setting to 4 instead of 3, 4 displays the commands on the command line as if you were entering them by hand, this was good enough for me!</p>
<pre># Verbose level, 1 through 5.
# 1     Quiet           Print fatal errors only
# 2     Default         Print errors and warnings only
# 3     Verbose         Show equivalent shell commands being executed
# 4     Extra Verbose   Show extra verbose information
# 5     Debug mode      Everything
#
verbose</pre>
<p>&#8220;logfile&#8221;, I uncommented this as logs are always handy for finding out what went wrong <img src='http://ubuntuhowto.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre># If you enable this, data will be written to the file you specify. The
# amount of data written is controlled by the "loglevel" parameter.
#
logfile /var/log/rsnapshot</pre>
<p>&#8220;exclude&#8221; After running my first backup it became apparent that I had a bunch of VMWare disk image files in my home dir, so I excluded them with:</p>
<pre># The include and exclude parameters, if enabled, simply get passed directly
# to rsync. If you have multiple include/exclude patterns, put each one on a
# separate line. Please look up the --include and --exclude options in the
# rsync man page for more details on how to specify file name patterns.
#
#include        ???
#include        ???
#exclude        ???
exclude         /home/keith/vmware-disks/</pre>
<p>The next thing I configured was the backup points, what I wanted backed up from each of my machines, starting with the localhost.</p>
<pre>###############################
### BACKUP POINTS / SCRIPTS ###
###############################

# LOCALHOST
backup  /home/          localhost/
backup  /etc/           localhost/
backup  /usr/local/     localhost/
backup  /var/log/               localhost/
backup  /srv/           localhost/
backup  /boot/          localhost/
backup  /opt/           localhost/</pre>
<p>Now I want to backup my email server &#8220;the-death-star&#8221;, so I configured my backup server to pull it&#8217;s data in over SSH (kinda of like when that Star Destroyer pulled in the Millennium Falcon with it&#8217;s tractor beam, yeah&#8230; Kind of&#8230;).</p>
<pre>backup  root@the-death-star.techspotting.org:/home/		the-death-star/
backup  root@the-death-star.techspotting.org:/etc/		the-death-star/</pre>
<pre>backup  root@the-death-star.techspotting.org:/usr/local/bin/   the-death-star/</pre>
<p>This is the end of the config file editing, now it&#8217;s time to give your config a test with:</p>
<pre>rsnapshot configtest</pre>
<p>This should come back and say &#8220;Syntax OK&#8221; unless you messed something up, in which case it will tell you the line it errors on, so go back and fix it!</p>
<p>SSH Keys</p>
<p>It&#8217;s all great pulling in the data over SSH but we need to be able to login automatically to our remote servers, we can&#8217;t just grab the data and drag it to our server, what do you think this is, a tractor beam?</p>
<p>I use remote root logins for my servers, as I am backing up files in locations like /etc/passwd which are only readable by root, yes there are ways around this, but I do not want this document to get to complex. I will do a separate blog post in the future for this, and link to it here.</p>
<p>So we need to setup SSH keys without passphrases, otherwise we are going to get prompted each time the backup runs for the pass phrase. So let me walk you through creating some SSH keys for key based authentication.</p>
<p>Create the key pair, this will create the public and private keys (never give your private key out!).</p>
<pre>ssh-keygen -t rsa</pre>
<p>Accept all the default, just push enter when it asks you for a passphrase</p>
<pre>Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.</pre>
<p>You should now have a set of keys in /root/.ssh/ now we need to copy them to the remote machine we want to login to, in this case the-death-star.techspotting.org so this would be the command:</p>
<pre>ssh-copy-id -i ~/.ssh/id_rsa.pub root@the-death-star.techspotting.org</pre>
<p>You will then get prompted for the password for your account on the remote host, go ahead and enter it, ssh-copy-id will then copy the key to the correct dir and sort out the correct file system permissions, cool huh?</p>
<p>Give it a test and make sure it&#8217;s working:</p>
<pre>ssh the-death-star.techspotting.org</pre>
<p>If you look in &#8220;/etc/cron.d/rsnapshot&#8221; you should see a file that looks like this:</p>
<pre># This is a sample cron file for rsnapshot.
# The values used correspond to the examples in /etc/rsnapshot.conf.
# There you can also set the backup points and many other things.
#
# To activate this cron file you have to uncomment the lines below.
# Feel free to adapt it to your needs.

# 0 */4         * * *           root    /usr/bin/rsnapshot hourly
# 30 3          * * *           root    /usr/bin/rsnapshot daily
# 0  3          * * 1           root    /usr/bin/rsnapshot weekly
# 30 2          1 * *           root    /usr/bin/rsnapshot monthly</pre>
<p>Providing you are happy with the default cron config (which I was) remove the comments so it looks like this:</p>
<pre># This is a sample cron file for rsnapshot.
# The values used correspond to the examples in /etc/rsnapshot.conf.
# There you can also set the backup points and many other things.
#
# To activate this cron file you have to uncomment the lines below.
# Feel free to adapt it to your needs.

0 */4         * * *           root    /usr/bin/rsnapshot hourly
30 3          * * *           root    /usr/bin/rsnapshot daily
0  3          * * 1           root    /usr/bin/rsnapshot weekly
30 2          1 * *           root    /usr/bin/rsnapshot monthly</pre>
<p>Now you have enabled cron to backup your files using rsnapshot, you had better make sure it is going to work!</p>
<pre>rsnapshot -t hourly</pre>
<p>Check everything looks sane and nothing nasty is going to happen and repeat for daily, weekly, monthly.</p>
<p>Now it&#8217;s time for your first backup!</p>
<pre>rsnapshot hourly</pre>
<p>If you have verbosity set to 4 like me (optional), you will be able to see all the files your backing up flying up the screen! The first backup has to move all the file the snapshot_root so this is going to take some time, depending on the speed of your machine / connection, might be a good time to grab another coffee.</p>
<p>You should start to see files in your snapshot_root, after a few weeks you should see a bunch of hourly.*, daily.*, weekly.*</p>
<p>Here is what my snapshot_root looks like:</p>
<pre>/backup/snapshots# ls -l
total 48
drwxr-xr-x 3 root root 4096 2010-03-21 18:19 daily.0
drwxr-xr-x 3 root root 4096 2010-03-21 18:19 daily.1
drwxr-xr-x 3 root root 4096 2010-03-21 18:18 daily.2
drwxr-xr-x 3 root root 4096 2010-03-21 17:57 daily.3
drwxr-xr-x 3 root root 4096 2010-03-21 17:57 daily.4
drwxr-xr-x 3 root root 4096 2010-03-21 17:56 daily.5
drwxr-xr-x 3 root root 4096 2010-03-21 18:20 hourly.0
drwxr-xr-x 3 root root 4096 2010-03-21 18:19 hourly.1
drwxr-xr-x 3 root root 4096 2010-03-21 18:19 hourly.2
drwxr-xr-x 3 root root 4096 2010-03-21 18:19 hourly.3
drwxr-xr-x 3 root root 4096 2010-03-21 18:19 hourly.4
drwxr-xr-x 3 root root 4096 2010-03-21 17:56 weekly.0</pre>
<p>Thats it, if you have any questions drop me a comment below and don&#8217;t forget to share using the share buttons <img src='http://ubuntuhowto.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntuhowto.org/rsnapshot-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.410 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2011-12-25 05:48:33 -->
<!-- Compression = gzip -->