<?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>Zenovation's Blog &#187; Web Server</title>
	<atom:link href="http://zenovations.com/blog/tag/web-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://zenovations.com/blog</link>
	<description>A blog about web design, programming, hosting, and virtualmin hacks</description>
	<lastBuildDate>Wed, 28 Jul 2010 23:33:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Valid flash in XHTML (killing &lt;embed&gt;)</title>
		<link>http://zenovations.com/blog/2008/09/valid-flash-in-xhtml-killing-embed/</link>
		<comments>http://zenovations.com/blog/2008/09/valid-flash-in-xhtml-killing-embed/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 21:02:05 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=154</guid>
		<description><![CDATA[I wanted to validate my xhtml code for the new site design, and ran into the following fun errors from w3c: Line 25, Column 15: there is no attribute "src". Line 26, Column 18: there is no attribute "wmode". Line 27, Column 17: there is no attribute "type". Line 28, Column 18: there is no [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to <a href="http://validator.w3.org/">validate my xhtml code</a> for the new site design, and ran into the following fun errors from <a href="http://www.w3c.org">w3c</a>:<br />
<code> Line 25, Column 15: there is no attribute "src".<br />
Line 26, Column 18: there is no attribute "wmode".<br />
Line 27, Column 17: there is no attribute "type".<br />
Line 28, Column 18: there is no attribute "width".<br />
Line 28, Column 31: there is no attribute "height".<br />
Line 28, Column 38: element "embed" undefined.<br />
</code><br />
<span id="more-154"></span></p>
<p>Which was caused by this tag, my <a href="http://www.digsby.com">Digsby</a> chat widget:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code3'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1543"><td class="code" id="p154code3"><pre class="html" style="font-family:monospace;">&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;190&quot; height=&quot;250&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;190&quot; height=&quot;250&quot; src=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</pre></td></tr></table></div>

<p>A little research and <a href="http://www.alistapart.com/stories/flashsatay/">an article from A List Apart later</a>, I&#8217;ve found valid input for including flash in Transitional XHTML:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code4'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1544"><td class="code" id="p154code4"><pre class="html" style="font-family:monospace;">&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;190&quot; height=&quot;250&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;190&quot; height=&quot;250&quot; src=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2008/09/valid-flash-in-xhtml-killing-embed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dropping multiple tables in mysql (drop tables with wildcard)</title>
		<link>http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/</link>
		<comments>http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 17:02:03 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/</guid>
		<description><![CDATA[I wanted to drop all mysql tables from a db that had a certain prefix, such as xx_. Well this turned out to be an adventure&#8230; The First Attempt The first solution I found was to use sed/grep sort of logic: ?View Code BASH#mysqlshow -u username -p dbname xx\\_% &#124;sed 's/[&#124;+-]//g'&#124;sed 's/[ ]*$/,/'&#62;droptables.sql (xx\\_% is [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to drop all mysql tables from a db that had a certain prefix, such as xx_. </p>
<p>Well this turned out to be an adventure&#8230;</p>
<p><strong>The First Attempt</strong></p>
<p>The first solution I found was to use sed/grep sort of logic:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p109code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1098"><td class="code" id="p109code8"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#mysqlshow -u username -p dbname xx\\_% |sed 's/[|+-]//g'|sed 's/[ ]*$/,/'&gt;droptables.sql</span></pre></td></tr></table></div>

<p>(xx\\_% is how you tell it to show tables starting with xx_)</p>
<p>This produced a semi-useful list. But I had to manually edit out the extra commas and line feeds to get a pure list, then add &#8220;DROP TABLE &#8221; to the beginning of the list. Then feed this into mysql as follows:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p109code9'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1099"><td class="code" id="p109code9"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#mysql -u username -p dbname &lt; droptables.sql</span></pre></td></tr></table></div>

<p>I wasn&#8217;t real happy with that answer, naturally, so I researched more&#8230;</p>
<p><strong>A Better Solution</strong></p>
<p>I came across an alternative in this command:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p109code10'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10910"><td class="code" id="p109code10"><pre class="bash" style="font-family:monospace;">mysqldump <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> <span style="color: #660033;">--add-drop-table</span> <span style="color: #660033;">--no-data</span> dbname <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^DROP.*\`xx_&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> mysql <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> dbname</pre></td></tr></table></div>

<p>(replace xx_ with the prefix you want to remove, to do all tables, try just &#8220;grep ^DROP&#8221;</p>
<p>You can test it first by cutting off the last &#8220;| mysql&#8230;&#8221; bit and see the output, which is useful for debugging, before you go blowing away your tables.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting services automatically in CentOS</title>
		<link>http://zenovations.com/blog/2008/08/starting-services-automatically-in-centos/</link>
		<comments>http://zenovations.com/blog/2008/08/starting-services-automatically-in-centos/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 03:24:03 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2008/08/starting-services-automatically-in-centos/</guid>
		<description><![CDATA[Had a service in CentOS 4 server that went down every time the box rebooted. Got tired of starting it manually so I had to go find the command to start it automagically. Surprisingly, it has nothing to do with &#8220;service&#8221;, which is how you start/stop it manually. It has the very unintuitive command &#8220;chkconfig&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Had a service in CentOS 4 server that went down every time the box rebooted. Got tired of starting it manually so I had to go find the command to start it automagically.</p>
<p>Surprisingly, it has nothing to do with &#8220;service&#8221;, which is how you start/stop it manually. It has the very unintuitive command &#8220;chkconfig&#8221; to make it start on boot. What a choice: chckconfig!</p>
<p>Oh well, here it is:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p108code12'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10812"><td class="code" id="p108code12"><pre class="bash" style="font-family:monospace;">chkconfig <span style="color: #660033;">--add</span> httpd
chkconfig httpd on</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2008/08/starting-services-automatically-in-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking out Virtualmin Pro on Ubuntu</title>
		<link>http://zenovations.com/blog/2007/11/checking-out-virtualmin-pro-on-ubuntu/</link>
		<comments>http://zenovations.com/blog/2007/11/checking-out-virtualmin-pro-on-ubuntu/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 16:14:56 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2007/11/checking-out-virtualmin-pro-on-ubuntu/</guid>
		<description><![CDATA[I&#8217;m setting up a new hosting server for several clients. I purchased a download of Virtualmin Pro and checked it out as a total management solution. Although it supports Ubuntu Edgy (6.06.1), it does not support 7.1. So I did what any good programmer would do&#8230; I tried it anyways. It failed. So I fixed [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m setting up a new hosting server for several clients. I purchased a download of Virtualmin Pro and checked it out as a total management solution. Although it supports Ubuntu Edgy (6.06.1), it does not support 7.1. </p>
<p>So I did what any good programmer would do&#8230; I tried it anyways. It failed. So I fixed the bug and tried it again. That one failed. So I went to the forums and got another suggestion and tried that one. It failed, burned down, fell over and sank into the swamp. So Installed 6.06.1 and the FOURTH ONE STAYED.</p>
<p>So don&#8217;t try virtualmin with 7.1, unless you&#8217;re glutton for punishment too&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2007/11/checking-out-virtualmin-pro-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing an SSH Server</title>
		<link>http://zenovations.com/blog/2007/11/securing-an-ssh-server/</link>
		<comments>http://zenovations.com/blog/2007/11/securing-an-ssh-server/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 22:24:23 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2007/11/securing-an-ssh-server/</guid>
		<description><![CDATA[I set up a new OpenSSH server on Ubuntu and had to remember how to lock down the settings again. Here is a quick guide to securing SSH against attacks. Set up an RSA key to use instead of a password This is an encrypted file which is used to replace your password, providing significant [...]]]></description>
			<content:encoded><![CDATA[<p>I set up a new OpenSSH server on Ubuntu and had to remember how to lock down the settings again. Here is a quick guide to securing SSH against attacks.</p>
<p><strong>Set up an RSA key to use instead of a password</strong><br />
This is an encrypted file which is used to replace your password, providing significant login security (there&#8217;s no way someone will guess one of these in the next 10,000 years).</p>
<p>This step assumes you are logged into the server where you will be ssh&#8217;ing to. To do this from the client, you create the keygen file as normal, but you then have to upload the id_rsa to your web server&#8217;s <span style="color: #008000;">~/.ssh/known_hosts</span> (instead of copying it locally as shown below).</p>
<p>Here is the procedure for generating the keyfiles:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p102code17'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10217"><td class="code" id="p102code17"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#generate the public/private key pair</span>
<span style="color: #666666; font-style: italic;">#leave the passphrase blank (or you'll have to type it constantly)</span>
kato<span style="color: #000000; font-weight: bold;">@</span>zephyr:~<span style="color: #000000; font-weight: bold;">/</span>$ <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span>
Generating public<span style="color: #000000; font-weight: bold;">/</span>private rsa key pair.
Enter <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #c20cb9; font-weight: bold;">which</span> to save the key <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kato<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Enter passphrase <span style="color: #7a0874; font-weight: bold;">&#40;</span>empty <span style="color: #000000; font-weight: bold;">for</span> no passphrase<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Enter same passphrase again:
Your identification has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kato<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.
Your public key has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kato<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub.
The key fingerprint is:
0d:a6:<span style="color: #7a0874; font-weight: bold;">cd</span>:1c:<span style="color: #000000;">53</span>:ab:b2:1b:b5:7e:ce:<span style="color: #000000;">15</span>:<span style="color: #000000;">96</span>:<span style="color: #000000;">35</span>:<span style="color: #000000;">97</span>:f9 kato<span style="color: #000000; font-weight: bold;">@</span>zephyr
kato<span style="color: #000000; font-weight: bold;">@</span>zephyr:~<span style="color: #000000; font-weight: bold;">/</span>.ssh$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kato<span style="color: #000000; font-weight: bold;">/</span>.ssh
kato<span style="color: #000000; font-weight: bold;">@</span>zephyr:~<span style="color: #000000; font-weight: bold;">/</span>.ssh$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
<span style="color: #660033;">-rw-------</span> <span style="color: #000000;">1</span> kato kato <span style="color: #000000;">1675</span> <span style="color: #000000;">2007</span>-<span style="color: #000000;">11</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">56</span> id_rsa
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> kato kato  <span style="color: #000000;">393</span> <span style="color: #000000;">2007</span>-<span style="color: #000000;">11</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">56</span> id_rsa.pub
<span style="color: #666666; font-style: italic;">#your server might show identity and identity.pub... that's fine, use those in place of id_rsa</span>
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> id_rsa.pub <span style="color: #000000; font-weight: bold;">&amp;</span>amp;gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;gt; authorized_keys
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">644</span> authorized_keys
kato<span style="color: #000000; font-weight: bold;">@</span>zephyr:~<span style="color: #000000; font-weight: bold;">/</span>.ssh$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> kato kato  <span style="color: #000000;">214</span> <span style="color: #000000;">2007</span>-<span style="color: #000000;">11</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">16</span>:04 authorized_keys
<span style="color: #660033;">-rw-------</span> <span style="color: #000000;">1</span> kato kato <span style="color: #000000;">1675</span> <span style="color: #000000;">2007</span>-<span style="color: #000000;">11</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">56</span> id_rsa
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> kato kato  <span style="color: #000000;">393</span> <span style="color: #000000;">2007</span>-<span style="color: #000000;">11</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">56</span> id_rsa.pub
<span style="color: #666666; font-style: italic;">#some older servers will require you to use authorized_keys2 for ssh2 clients!</span></pre></td></tr></table></div>

<p>Now download the private file (the one without .pub on the end) to your client. You will want to configure your client to load this keyfile automatically. This is easy enough with putty, for other clients, check out pageant (which can intercept password requests and supply the key).<br />
[img]putty_keyfile.jpg:Loading ssh key into putty&#8230;[img]</p>
<ol>
<li>First decide if you will be using SSH1 or SSH2 (or both). Most likely you&#8217;ll want to stick with SSH1 (until OpenSSH is installed at PPPL, or until SSH2 is installed, etc).</li>
<li>Generate public/private keypair for SSH1: [b]ssh-keygen[/b]. This will generate [b]~/.ssh/identity[/b] and [b]~/.ssh/identity.pub[/b].</li>
<li>Do this on each machine you want to access (to/from) using ssh (only need to do this once on the PPPL unix cluster)</li>
<li>Take all of the identity.pub files (which contain a public key on one line) and create an [b]~/.ssh/authorized_keys[/b] file by placing the contents of each separate identity.pub file on a single line of the [b]~/.ssh/authorized_keys[/b] file (then place on all sshable hosts).</li>
<li>For SSH2, use [b]ssh-keygen -t {rsa,dsa}[/b] (you choose between rsa keys or dsa keys, currently I use DSA), which will generate [b]~/.ssh/id_{dsa,rsa}[/b] and [b]~/.ssh/id_{dsa,rsa}.pub[/b].</li>
<li>Follow instructions for SSH1 keys, but instead generate a [b]~/.ssh/authorized_keys2[/b] file using the id_{dsa,rsa}.pub files.</li>
</ol>
<p><strong>Specify who can log in with ssh</strong><br />
From the cli, type:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p102code18'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10218"><td class="code" id="p102code18"><pre class="bash" style="font-family:monospace;">groupadd sshaccess</pre></td></tr></table></div>

<p>Then add your login account:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p102code19'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10219"><td class="code" id="p102code19"><pre class="bash" style="font-family:monospace;">usermod <span style="color: #660033;">-a</span> <span style="color: #660033;">-G</span> sshaccess kato</pre></td></tr></table></div>

<p><b>Configure SSH</b><br />
On Ubuntu and Gentoo, open [b]/etc/ssh/sshd_config[/b]. Now we will tweak several properties:</p>
<ol>
<li>Changing the <span style="color: #008000;">Port</span> will shut off 98% of the attacks on your ssh server. As long as you have the skills to get through the firewall, this is your best defense. To pick a port number which won&#8217;t conflict with any other apps, check out this <a href=""http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers"">comprehensive list of ports</a>. I used port 27.</li>
<li>Turn off <span style="color: #080000;">PermitRootLogin</span></li>
<li>Enable <span style="color: #008000;">PubKeyAuthentication</span></li>
<li>Do not <span style="color: #080000;">PermitEmptyPassword</span></li>
<li>Restrict users who can log in with <span style="color: #008000;">AllowGroups</span></li>
<li>Enable logging with <span style="color: #008000;">SysLogFacility</span> and <span style="color: #008000;">LogLevel</span></li>
</ol>
<p>Here is what my finished script looks like:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p102code20'); return false;">View Code</a> PROPS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10220"><td class="code" id="p102code20"><pre class="props" style="font-family:monospace;"># What ports, IPs and protocols we listen for
@@Port 27
&nbsp;
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
&nbsp;
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
&nbsp;
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
&nbsp;
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
&nbsp;
# Logging
SyslogFacility AUTH
LogLevel INFO
&nbsp;
# Authentication:
LoginGraceTime 120
@@PermitRootLogin no
StrictModes yes
&nbsp;
#RSAAuthentication yes
@@PubkeyAuthentication yes
#AuthorizedKeysFile     %h/.ssh/authorized_keys
&nbsp;
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
@@RhostsRSAAuthentication no
# similar for protocol version 2
@@HostbasedAuthentication no
&nbsp;
# To enable empty passwords, change to yes (NOT RECOMMENDED)
@@PermitEmptyPasswords no
&nbsp;
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
&nbsp;
# Change to no to disable tunnelled clear text passwords
@@PasswordAuthentication no
&nbsp;
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
&nbsp;
# Allow client to pass locale environment variables
AcceptEnv LANG LC_
@@AllowGroups termgroup
&nbsp;
Subsystem sftp /usr/lib/openssh/sftp-server
&nbsp;
UsePAM yes</pre></td></tr></table></div>

<p><strong>References</strong><br />
<a href="http://www.electrictoolbox.com/article/linux-unix-bsd/create-rsa-dsa-keys-ssh">Creating RSA and DSA keys for SSH</a><br />
<a href="http://www.securityfocus.com/infocus/1810">SSH User dentities</a><br />
<a href="http://w3.pppl.gov/cppg/seminars/papers/linux_talk/node11.html">Creating SSH Key Pairs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2007/11/securing-an-ssh-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure Ubuntu Server with Static IP Address</title>
		<link>http://zenovations.com/blog/2007/11/configure-ubuntu-server-with-static-ip-address/</link>
		<comments>http://zenovations.com/blog/2007/11/configure-ubuntu-server-with-static-ip-address/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 21:35:48 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2007/11/configure-ubuntu-server-with-static-ip-address/</guid>
		<description><![CDATA[I wanted to set up an Ubuntu server at home, but the install CD automagically sets it up using dhcp. Tsk, tsk; who wants a web server with a dynamic ip address, after all? Here is how to get it running with a static ip&#8230; Edit /etc/network/interfaces Adjust as needed&#8230; here is a sample config [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to set up an Ubuntu server at home, but the install CD automagically sets it up using dhcp. Tsk, tsk; who wants a web server with a dynamic ip address, after all?  Here is how to get it running with a static ip&#8230;</p>
<p>Edit /etc/network/interfaces</p>
<p>Adjust as needed&#8230; here is a sample config for a linksys/d-link home network:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code22'); return false;">View Code</a> PROPS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10122"><td class="code" id="p101code22"><pre class="props" style="font-family:monospace;"># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
&nbsp;
# The loopback network interface
auto lo
iface lo inet loopback
&nbsp;
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0
&nbsp;
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2007/11/configure-ubuntu-server-with-static-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
