<?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>Equivalence &#187; Cloud Computing</title>
	<atom:link href="http://equivalence.co.uk/archives/category/cloud-computing/feed" rel="self" type="application/rss+xml" />
	<link>http://equivalence.co.uk</link>
	<description>Technical Blog for Software Developers</description>
	<lastBuildDate>Wed, 04 Apr 2012 22:32:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>the budget VPS dilemma</title>
		<link>http://equivalence.co.uk/archives/1895</link>
		<comments>http://equivalence.co.uk/archives/1895#comments</comments>
		<pubDate>Fri, 16 Mar 2012 00:30:58 +0000</pubDate>
		<dc:creator>Gregg</dc:creator>
				<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[UK VPS]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://equivalence.co.uk/?p=1895</guid>
		<description><![CDATA[My time with the free Amazon EC2 micro instance drew to a close in the last few weeks, that coupled with a few minor instance freezes in the last couple of months got me interested in moving the sites that I run elsewhere. Traffic to my sites is relatively low, maybe a few hundred hits [...]]]></description>
			<content:encoded><![CDATA[<p>My time with the free Amazon EC2 micro instance drew to a close in the last few weeks, that coupled with a few minor instance freezes in the last couple of months got me interested in moving the sites that I run elsewhere. Traffic to my sites is relatively low, maybe a few hundred hits a day max. Given this, a cheap VPS package looked to be exactly what was required.</p>
<p>First up, I done a rough calculation that showed that if I wanted to keep my EC2 micro instance running then if I took out a 3 year reserved instance it was likely to cost me (on average) around £50 per year for a US West instance over the next 3 years and closer to £65 per year for an EU based instance. Both of these are pretty good value for money &#8211; and since these sites are essentially a cost sink this is of at least some importance.</p>
<p>However, given the hassle I&#8217;d been having with my instance freezing I thought #1 is this going to keep happening and #2 if I take a reserved instance for 3 years then I&#8217;m kind of tied down.</p>
<p>In the past I&#8217;d been slightly ambivalent about what country the server was hosted in. With Amazon I&#8217;d thought screw it, I&#8217;ll host it in the US West as it was cheaper, thinking that my traffic tends to be spread throughout the world with maybe a slight leaning towards the US. However lately while creating some backups and trying to copy them locally, I released that this might be OK in terms of people viewing a site but it was a solid pain in the ass when taking full backups off the server to my local drive. So I started looking at VPS providers in the UK.</p>
<p>Surprisingly the cost of having your own VPS has nose-dived &#8211; I presume this is due to Amazon driving down prices, cheaper hardware and advances in virtualisation software. After looking around I managed to find a decent deal (~£47 a year with <a href="http://www.burstnet.eu">www.burstnet.eu</a>) for a VPS with 512MB RAM, 20GB hard disk, and 1GHz CPU speed on a UK based server &#8211; I&#8217;ll stress again how much better it is to have servers in your own country when using SSH and copying files.</p>
<p>Now some might be asking why not just go for shared hosting? Well for many this is likely to be a good option. However, when you are running more than 2-3 sites I found that using a VPS is likely to come in at the same price if not cheaper. Plus, I rather enjoy installing the software, setting up the servers, admin of the server, etc. Sure, I may screw it up from time-to-time, but over the years I have learned quite a bit from doing things like this myself. This knowledge has been useful on many occasion. If you write software then you really should know at least something about the platform it runs on &#8211; maybe this is old fashioned now I dunno.</p>
<p>Anyway I actually started this post aiming to discuss how I set up WordPress, PHP, nginx, etc on my budget VPS but I&#8217;ve gone on way too long already. That&#8217;ll have to be a topic for another day. Instead I&#8217;ll wrap this up by summerising that:</p>
<ol>
<li>Amazon may not always be the cheapest &#8211; except in the first year where a micro instance is free, and you can&#8217;t beat free;</li>
<li>Check <a href="http://www.lowendbox.com">www.lowendbox.com</a> to see if there are any nice deals going;</li>
<li>Try to find a server that is geographically close to you if possible;</li>
<li>If you&#8217;re a developer, get a Linux VPS, even if it does costs you, call it an investment in your career &#8211; OK, you can do this stuff on a local Linux machine but it ain&#8217;t the same. It&#8217;s good to know how to set up a web server, configure it, and other general server admin tasks. If you ever plan to scale something one day these things will be important. It even gives you a chance to use vi or vim and wonder why the fuck people put themselves though that <img src='http://equivalence.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ;</li>
<li>Having your own server also allows you to make mistakes without that stomach churning moment you get when you realise you&#8217;ve screwed something up at work &#8211; you can now screw up on your own time first;</li>
<li>Running your own server also gives you a better idea on what the performance of your application is. I&#8217;m pretty sure it will surprise you. I thought 512MB was a crazy amount of RAM for a few simple sites. It&#8217;s amazing how it all adds up when you are running a DB and a web server with several websites on one VPS. However that&#8217;s the post I was trying to write when I started this. That&#8217;ll be next.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://equivalence.co.uk/archives/1895/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>idiot’s guide to linux on amazon ec2 – part 2</title>
		<link>http://equivalence.co.uk/archives/1578</link>
		<comments>http://equivalence.co.uk/archives/1578#comments</comments>
		<pubDate>Wed, 13 Jan 2010 00:34:26 +0000</pubDate>
		<dc:creator>Gregg</dc:creator>
				<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[thin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=1578</guid>
		<description><![CDATA[In Part 1 I covered how to remove the root login, create a new user, and add this user to the list of sudoers on an linux ec2 instance. In this section I will cover how I got Ruby on Rails, MySQL, Nginx and Thin working together on the Ubuntu instance. First up, I think [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.equivalence.co.uk/archives/1521">Part 1</a> I covered how to remove the root login, create a new user, and add this user to the list of sudoers on an linux ec2 instance. In this section I will cover how I got <a href="http://rubyonrails.org/">Ruby on Rails</a>, <a href="http://mysql.com">MySQL</a>, <a href="http://nginx.org">Nginx</a> and <a href="http://code.macournoyer.com/thin/">Thin</a> working together on the <a href="http://www.ubuntu.com/">Ubuntu</a> instance.</p>
<p>First up, I think it&#8217;s worth taking a moment to explain what Nginx and Thin actually are, as they are maybe not as well known as the others.</p>
<p>Nginx is a very fast web/proxy server developed by <a href="http://sysoev.ru/en/">Igor Sysoev</a>.  According to wikipedia it currently runs, amongst others, the WordPress and Github websites.</p>
<p>Thin is a ruby web server that &#8220;glues together 3 of the best Ruby libraries in web history&#8221;[1]:</p>
<blockquote><ol>
<li>the Mongrel parser, the root of Mongrel speed and security</li>
<li>Event Machine, a network I/O library with extremely high scalability, performance and stability</li>
<li>Rack, a minimal interface between webservers and Ruby frameworks</li>
</ol>
</blockquote>
<p>Right on to the job at hand and first up was getting <code>apt-get</code> working!</p>
<p>To my surprise (but probably widely known) the Ubuntu ec2 instance did not come with <a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool"><code>apt</code></a> pre-configured &#8211; unlike <code>yum</code> on a Fedora instance I had previously used. Instead you first have to run <code>apt-get update</code> to download the list of package locations. Now that we&#8217;ve done this we can get to work installing the other bit of software required.</p>
<p><strong>MySQL</strong><br />
The first thing we need to install are the MySQL client and server. To do this run the commands:</p>
<p><code>sudo apt-get install mysql-server</code><br />
<code>sudo apt-get install mysql-client</code></p>
<p>Then you need to make sure that the root password for MySQL is set to something secure. This can be done using:</p>
<p><code>sudo mysqladmin -u root a_good_secure_password</code></p>
<p><strong>Ruby</strong><br />
Now it&#8217;s time to install Ruby on Rails. First we need to install ruby, rake, rubygems, and a couple of other useful packages. The following commands should add the required binaries to your path:</p>
<p><code>sudo apt-get install rubygems</code><br />
<code>sudo apt-get install build-essential</code><br />
<code>sudo apt-get install rake</code><br />
<code>sudo apt-get install ruby-full</code></p>
<p>We can now use <code>gem</code> to install rails:</p>
<p><code>sudo gem install rails</code></p>
<p>As we will be using MySQL you probably also want to install the MySQL client development library in order to get the ruby gem to build/install correctly. This can be done by running:</p>
<p><code>sudo apt-get install libmysqlclient15-dev</code></p>
<p>Obviously the version of the libmysqlclient will depend on the MySQL version that you are using. Finally we can install the mysql gem by running:</p>
<p><code>sudo gem install mysql</code></p>
<p><strong>Nginx and Thin</strong><br />
To install the nginx package we run the command:</p>
<p><code>sudo apt-get install nginx</code></p>
<p>Nginx then needs to be started so we run:</p>
<p><code>sudo /etc/init.d/nginx start</code></p>
<p>By default the package should also add the entries required to restart nginx if the instance is rebooted &#8211; you can always check by looking in the /etc/rcX.d directory (where X is the run-level number).</p>
<p>Now it&#8217;s time to install thin:</p>
<p><code>sudo apt-get install thin</code></p>
<p><strong>Creating application config files for Thin and Nginx</strong><br />
It is a good idea to create config files that can be used to restart your thin clusters. To do this we use the <code>thin config</code> command. Now, let&#8217;s assume the app is called <code>myapp</code> and so we run the following command:</p>
<p><code>sudo thin config -C /etc/thin/myapp.yaml -c ~user/www/myapp --servers 3 -e production</code></p>
<p>This creates a thin config file /etc/thin/myapp.yaml that starts 3 instances of the rails application found in ~user/www/myapp using the production environment. By default it will start the first server on port 3000 and the next on 3001, and so on. Should you wish to specify the port you can supply it with the -p option, i.e. -p 6666.</p>
<p>You can now start your thin clients using:</p>
<p><code>sudo /etc/init.d/thin start -C myapp.yaml</code></p>
<p>It&#8217;s worth noting that if you don&#8217;t specify the -C option <code>thin</code> will use the config files found in <code>/etc/thin</code> and start the thin clients for each config file found in this directory.</p>
<p>As we want to use nginx as a proxy to our thin client instances we must create a nginx config file for our application. An example of such a config file is shown below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">upstream myapp <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    server 127.0.0.1:<span style="color: #000000;">3000</span>;
    server 127.0.0.1:<span style="color: #000000;">3001</span>;
    server 127.0.0.1:<span style="color: #000000;">3002</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
server <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    listen   <span style="color: #000000;">80</span> default;
    server_name example.co.uk;
&nbsp;
    access_log <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>myapp<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>access.log;
    error_log <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>myapp<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>error.log;
&nbsp;
    root   <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>myapp<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>;
    index  index.html;
&nbsp;
    location <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;">#auth_basic &quot;Please supply login details&quot;;</span>
        <span style="color: #666666; font-style: italic;">#auth_basic_user_file /home/user/www/myapp/public/protect.passwd;</span>
        proxy_set_header  X-Real-IP  <span style="color: #007800;">$remote_addr</span>;
        proxy_set_header  X-Forwarded-For <span style="color: #007800;">$proxy_add_x_forwarded_for</span>;
        proxy_set_header Host <span style="color: #007800;">$http_host</span>;
        proxy_redirect off;
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-f <span style="color: #007800;">$request_filename</span><span style="color: #000000; font-weight: bold;">/</span>index.html<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            rewrite <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/</span>index.html;
            <span style="color: #7a0874; font-weight: bold;">break</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-f <span style="color: #007800;">$request_filename</span>.html<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            rewrite <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">$1</span>.html;
            <span style="color: #7a0874; font-weight: bold;">break</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>-f <span style="color: #007800;">$request_filename</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            proxy_pass http:<span style="color: #000000; font-weight: bold;">//</span>myapp;
            <span style="color: #7a0874; font-weight: bold;">break</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>Lines 1-5 set up the proxy for our thin clients that we started on ports 3000-3002. The values that you include here obviously depend on the number of clients that you started and the ports they are running on. The rest of the file is dedicated to setting up the web server with the majority of settings being pretty self explanatory, so I&#8217;ll only highlight the important bits.</p>
<p>First, we see that the server waits for requests on port 80 and the domain used for this site is example.co.uk (lines 8-9). It&#8217;s worth noting that hosting a subdomain, say subdomain.example.co.uk, is as easy as replacing example.co.uk in line 9 with subdomain.example.co.uk.  Lines 20-23 take care of things like forwarding the real IP address to rails as well as some other set up required for https. Finally the remaining lines in the file check to see if an index.html file is available at the url specified and if so displays displays it (lines 25-28), serve static files straight up (lines 30-33), and finally if the file specified by the url does not exit on the file system it sets headers and proxies for our thin clients and passes it on.</p>
<p>As a side note, lines 18 and 19 that are commented out enable basic http authentication in nginx. You can uncomment out these lines if you require this feature. The password file for http auth can be generated using the apache util <code>htpasswd</code> &#8211; you will need to install the package that contains the htpasswd utility.</p>
<p>The config file (let&#8217;s call it <code>myapp</code>) is placed in <code>/etc/nginx/sites-available</code>, and finally a sim link is set up between the <code>sites-available</code> directory to the <code>sites-enabled</code> directory to enable the website:</p>
<p><code>sudo ln -s sites-available/myapp sites-enabled/myapp</code></p>
<p>That&#8217;s it. All we need to do now is restart nginx (<code>/etc/init.d/nginx restart</code>) and assuming your config is ok the site should now be up and running. (If nginx is already running and you want to parse the config without restarting you can always get the pid of the nginx process, <code>ps aux | egrep '(PID|nginx)'</code>, and run <code>sudo kill -HUP PID</code> &#8211; in fact this is all you actually need to do to get your site up and running)</p>
<p>[1] The Thin homepage &#8211; <a href="http://code.macournoyer.com/thin/">http://code.macournoyer.com/thin/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://equivalence.co.uk/archives/1578/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>idiot&#8217;s guide to linux on amazon ec2 &#8211; part 1</title>
		<link>http://equivalence.co.uk/archives/1521</link>
		<comments>http://equivalence.co.uk/archives/1521#comments</comments>
		<pubDate>Tue, 15 Dec 2009 01:30:31 +0000</pubDate>
		<dc:creator>Gregg</dc:creator>
				<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[rabbitmq]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=1521</guid>
		<description><![CDATA[Recently I&#8217;ve had the opportunity of setting up a Linux instance on Amazon EC2 for use with Ruby on Rails, MySQL, Nginx and Rabbit MQ. I suspect much of what I will document is obvious to many but hopefully some of you may find it useful, especially, if like me, you are totally inexperienced with [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve had the opportunity of setting up a Linux instance on <a href="http://aws.amazon.com/ec2">Amazon EC2</a> for use with <a href="http://rubyonrails.org">Ruby on Rails</a>, <a href="http://www.mysql.com">MySQL</a>, <a href="http://nginx.org">Nginx</a> and <a href="http://www.rabbitmq.com">Rabbit MQ</a>. I suspect much of what I will document is obvious to many but hopefully some of you may find it useful, especially, if like me, you are totally inexperienced with setting up a Linux server.</p>
<p>As it turns out I&#8217;ll probably document this over a couple of posts as it took up a bit more time and space than I first anticipated. In this first part I will cover, logging in as the root user, adding a new user, generating their ssh key, adding the user to the list of sudoers, and finally disabling root login via ssh. I&#8217;ll update this article with links to the other parts as I create them (<a href="http://www.equivalence.co.uk/archives/1521">Part 2</a>).</p>
<p>Right, first things first, some background info. Rightly or wrongly we required the server to do more than one thing, hence the list of items to install. So to reduce this number I picked an image with RabbitMQ pre-installed &#8211; as setup of this was uncharted territory for me. A consequence of this choice was that it pushed us down the path of <a href="http://www.ubuntu.com">Ubuntu</a> and the latest version which is currently 9.10. So let&#8217;s get to it.</p>
<p>The goal here is to disable remote root login, and in doing so we need to create a new user, and give him the ability to <a href="http://en.wikipedia.org/wiki/Sudo">sudo</a> commands. To do that we first need to login to our new EC2 image &#8211; which took me a little time to figure out! This can be done from Windows using <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">putty</a>. However, we must first use <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">puttygen</a> to generate a putty ssh auth key (putty doesn&#8217;t understand the key generated by Amazon) from your Amazon keypair which can be found in the AWS Management Console under Key Pairs.  Check out <a href="http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide">this link</a> for further information.</p>
<p>Now on to the real work.</p>
<p><strong>Adding a user and generating their ssh key</strong><br />
Follow the process below to add a new user and generate an ssh key for this user.</p>
<ol>
<li>Login as root using method described above</li>
<li>Run <code>adduser webuser</code> &#8211; where <code>webuser</code> is the name of the user we are adding. Fill in the details including the password of this user.</li>
<li>Type <code>su webuser</code> &#8211; to run a shell as this user without logging out</li>
<li>Execute <code>ssh-keygen -t dsa</code> from this users home directory</li>
<li>Rename the file <code>~/.ssh/id_dsa.pub</code> to <code>~/.ssh/authorized_keys</code></li>
<li>Take a copy of the generated private key (should be in <code>~/.ssh/id_dsa</code>) and copy it to your local machine</li>
<li>Now use puttygen to generate the ssh key from <code>id_dsa</code></li>
<li>Finally login using putty and the new key &#8211; you should only have to specify your username when logging in.</li>
</ol>
<p><strong>Adding your new user to the list of sudoers</strong><br />
This is a very basic sudoers setup as we are only adding a single sudo user to the <code>/etc/sudoers</code> file. I know you can do way more complicated things with this but what is documented here was sufficient for our needs. So let&#8217;s get on with it.</p>
<ol>
<li>Login as <code>root</code></li>
<li>Run <code>visudo</code> &#8211; this is an editor for the sudoers file to stop multiple people editing the file at the same time</li>
<li>Locate the lines below in the editor<br />
<blockquote><p><code># User privilege specification<br />
root    ALL=(ALL) ALL</code></p></blockquote>
<p>and change this to </p>
<blockquote><p><code># User privilege specification<br />
root    ALL=(ALL) ALL<br />
webuser    ALL=(ALL) ALL</code></p></blockquote>
</li>
<li>If you would like to allow the user to sudo without having to supply a password then you need to add the following line as well:<br />
<blockquote><p><code>webuser ALL=NOPASSWD: ALL</code></p></blockquote>
</li>
<li>Now save the file and exit &#8211; ensure that the changes are saved to <code>/etc/sudoers</code></li>
</ol>
<p><strong>Disabling root login</strong></p>
<ol>
<li>Login as <code>webuser</code></li>
<li>Run <code>sudo vi /etc/ssh/sshd_config</code> &#8211; you can replace <code>vi</code> with another editor if you please, I&#8217;ve heard <code>nano</code> might be a little more friendly to windows users!</li>
<li>Find the line <code>PermitRootLogin </code>and change it to:<br />
<blockquote><p><code>PermitRootLogin no</code></p></blockquote>
<p>If I remember correctly in the instance I was using there was more than one line with <code>PermitRootLogin</code> so it may be worth check for this yourself.
</li>
<li>As a side note, should you wish to allow login using passwords rather than using a ssh key (this maybe what users familiar with shared hosting are used to) you can enable this by changing the relevant line in <code>sshd_config</code> to:<br />
<blockquote><p><code>PasswordAuthentication yes</code> </p></blockquote>
</li>
<li>Finally, restart <code>sshd</code> by running <code>sudo /etc/init.d/ssh restart</code> </li>
</ol>
<p>You should now be able to login in using <code>webuser</code>, and <code>sudo</code> commands as <code>webuser</code> that require to be run as <code>root</code>. Additionally, <code>root</code> login from a remote server has also been disabled. </p>
<p>There may be better ways to do the above, but what I&#8217;ve documented works. I may also be missing stuff, if so, let me know and I will update this. Well, that&#8217;s it for now. Check back soon for Part 2 which will be on it&#8217;s way shortly.</p>
<p><strong>Update</strong>: <a href="http://www.equivalence.co.uk/archives/1578">idiot&#8217;s guide to linux on amazon ec2 &#8211; part 2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://equivalence.co.uk/archives/1521/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

