<?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>Enterprise-Java.co.uk</title>
	<atom:link href="http://www.enterprise-java.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.enterprise-java.co.uk</link>
	<description>From Debian to Java and everything inbetween</description>
	<pubDate>Sat, 23 Aug 2008 21:20:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Monitoring and measuring bandwidth</title>
		<link>http://www.enterprise-java.co.uk/debian/managing-and-measuring-bandwidth/</link>
		<comments>http://www.enterprise-java.co.uk/debian/managing-and-measuring-bandwidth/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 21:19:10 +0000</pubDate>
		<dc:creator>mark</dc:creator>
		
		<category><![CDATA[debian]]></category>

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

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

		<guid isPermaLink="false">http://www.enterprise-java.co.uk/?p=26</guid>
		<description><![CDATA[True &#8220;unlimited&#8221; bandwidth is pretty much dead these days, and so it should be in my opinion. I would much rather have high speed and a fixed amount bandwidth than be forced to a limited amount of bandwidth by having a slow access speed.
Whether you have a shared hosting, a vps or a dedicated server [...]]]></description>
			<content:encoded><![CDATA[<p>True &#8220;unlimited&#8221; bandwidth is pretty much dead these days, and so it should be in my opinion. I would much rather have high speed and a fixed amount bandwidth than be forced to a limited amount of bandwidth by having a slow access speed.</p>
<p>Whether you have a shared hosting, a vps or a dedicated server you are most likely to have a fixed amount of bandwidth whether you know it or not.</p>
<p>I&#8217;ve decided to monitor and measure my bandwidth usage from the start. I think its generally good practice and I certainly don&#8217;t want to get stung by excess charges if I use more than my host allows. Also a sudden increase could be a sign of a security breach.</p>
<p>I installed a couple of applications, the first was a real time bandwidth monitoring tool.</p>
<pre># apt-get install bwm</pre>
<pre>sailes:/# bwm</pre>
<pre>Bandwidth Monitor 1.1.0
Iface        RX(KB/sec)   TX(KB/sec)   Total(KB/sec)

lo            0.000        0.000           0.000
eth0            5.497       21.489          26.9860

Total            5.497       21.489         26.9860

Hit CTRL-C to end this madness.</pre>
<p>The second records and summaries my bandwidth usage by hour and day.</p>
<p><code># apt-get install vnstat</code></p>
<p>Check your interfaces with ifconfig</p>
<p><code># vnstat -u -i eth0</code></p>
<pre>sailes:/# vnstat</pre>
<pre>Database updated: Sat Aug 16 22:20:01 2008</pre>
<pre>       eth0

           received:         895.92 MB (45.9%)
        transmitted:           1053 MB (54.1%)
              total:           1949 MB

                        rx     |     tx     |  total
        -----------------------+------------+-----------
        yesterday     12.75 MB |   83.79 MB |   96.54 MB
            today        25 MB |  104.73 MB |  129.74 MB
        -----------------------+------------+-----------
        estimated        26 MB |     111 MB |     137 MB</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.enterprise-java.co.uk/debian/managing-and-measuring-bandwidth/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Debian SSH Security</title>
		<link>http://www.enterprise-java.co.uk/debian/debian-ssh-security/</link>
		<comments>http://www.enterprise-java.co.uk/debian/debian-ssh-security/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 20:26:43 +0000</pubDate>
		<dc:creator>mark</dc:creator>
		
		<category><![CDATA[debian]]></category>

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

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

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

		<guid isPermaLink="false">http://www.enterprise-java.co.uk/?p=16</guid>
		<description><![CDATA[Within two days of having my out of the box Debian install exposed to the internet I realised something had to be done about my SSH security.
I was getting a large amount of attempts to access my server. This was logged to /var/log/auth.log.
Attempts ranging from guessing the system&#8217;s users:
Aug 12 19:01:04 sailes sshd[11017]: Invalid user [...]]]></description>
			<content:encoded><![CDATA[<p>Within two days of having my out of the box Debian install exposed to the internet I realised something had to be done about my SSH security.</p>
<p>I was getting a large amount of attempts to access my server. This was logged to /var/log/auth.log.</p>
<p>Attempts ranging from guessing the system&#8217;s users:</p>
<p><code>Aug 12 19:01:04 sailes sshd[11017]: Invalid user alex from 221.11.123.149<br />
Aug 12 19:01:04 sailes sshd[11017]: (pam_unix) check pass; user unknown<br />
Aug 12 19:01:04 sailes sshd[11017]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.11.123.149<br />
Aug 12 19:01:05 sailes sshd[11017]: Failed password for invalid user alex from 221.11.123.149 port 41122 ssh2<br />
Aug 12 19:01:08 sailes sshd[11021]: Invalid user brett from 221.11.123.149<br />
Aug 12 19:01:09 sailes sshd[11021]: (pam_unix) check pass; user unknown<br />
Aug 12 19:01:09 sailes sshd[11021]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.11.123.149<br />
Aug 12 19:01:11 sailes sshd[11021]: Failed password for invalid user brett from 221.11.123.149 port 41238 ssh2<br />
Aug 12 19:01:13 sailes sshd[11025]: Invalid user mike from 221.11.123.149<br />
Aug 12 19:01:14 sailes sshd[11025]: (pam_unix) check pass; user unknown<br />
Aug 12 19:01:14 sailes sshd[11025]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.11.123.149<br />
Aug 12 19:01:16 sailes sshd[11025]: Failed password for invalid user mike from 221.11.123.149 port 41366 ssh2<br />
Aug 12 19:01:19 sailes sshd[11029]: Invalid user alan from 221.11.123.149<br />
Aug 12 19:01:19 sailes sshd[11029]: (pam_unix) check pass; user unknown<br />
Aug 12 19:01:19 sailes sshd[11029]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.11.123.149 </code></p>
<p>To attempting to brute force the root password:<br />
<code>Aug 16 21:05:12 sailes sshd[24111]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=65.75.189.67  user=root<br />
Aug 16 21:05:14 sailes sshd[24111]: Failed password for root from 65.75.189.67 port 36171 ssh2<br />
Aug 16 21:05:15 sailes sshd[24115]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=65.75.189.67  user=root<br />
Aug 16 21:05:18 sailes sshd[24115]: Failed password for root from 65.75.189.67 port 36489 ssh2</code></p>
<p>Also alsorts of crazy other error messages which no doubt came from attempting to exploit various potential security flaws.</p>
<p>This was obviously not a good situation, luckily many people offered advice. Ideally what I should have done was to only allow management access to my own static ip address. But this doesn&#8217;t suit me, I like to be able to do anything from anywhere.</p>
<p>Another suggestion was to change the port ssh listens on. This is a very good suggestion, and one I would pass onto others. It seems like 99% of the attackers don&#8217;t bother to check for ssh listening on a non-standard port. I didn&#8217;t want to do this because that would mean I would have to remember yet another custom port, but also due to strict firewall policies I had to contend with.</p>
<p>Finally I decided on installing a piece of software called <a href="http://denyhosts.sourceforge.net/">DenyHost</a><br />
<code><br />
# apt-get install denyhost</code></p>
<p>This python application runs frequently throught the day monitoring my auth.log, when it sees suspicious behaviour it bans the ip address from the service.</p>
<p>Now my hosts.deny file is now increasing almost daily with naughty ip addresses.</p>
<p><code>sailes:/# cat /etc/hosts.deny<br />
sshd: 221.11.123.149<br />
sshd: 89.96.182.197<br />
sshd: 211.239.157.222</code></p>
<p>Although this is not the most secure option, I feel it best suits my needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.enterprise-java.co.uk/debian/debian-ssh-security/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
