<?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>~#nixy</title>
	<atom:link href="http://nixy.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://nixy.dk</link>
	<description>Nix is sexy</description>
	<lastBuildDate>Fri, 16 Oct 2009 09:04:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New VPS and the troubles</title>
		<link>http://nixy.dk/2009/10/16/new-vps-and-the-troubles/</link>
		<comments>http://nixy.dk/2009/10/16/new-vps-and-the-troubles/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 09:00:22 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[Web servers]]></category>
		<category><![CDATA[arpnetworks]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[lighty]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://nixy.dk/?p=23</guid>
		<description><![CDATA[The past few weeks, I&#8217;ve been configuring a VPS I&#8217;ve rented from the guys at ARP Networks. This post isn&#8217;t supposed to be a plug for their excellent service and value, but let me just mention they actually have a channel on freenode. How great is that?
Anyway, on a VPS you should do anything you can [...]]]></description>
			<content:encoded><![CDATA[<p>The past few weeks, I&#8217;ve been configuring a VPS I&#8217;ve rented from the guys at <a href="http://www.arpnetworks.com/">ARP Networks</a>. This post isn&#8217;t supposed to be a plug for their excellent service and value, but let me just mention they actually have a <em>channel</em> on <em>freenode</em>. How great is that?</p>
<p>Anyway, on a VPS you should do anything you can to minimize resource usage &#8211; because it&#8217;s just nicer that way. This was a good chance for me to scrap apache httpd, which in all honesty is a bit like the Hummer of web servers. Figure out the perfect analogy yourself, apache is heavy.</p>
<p>There are, as I understand, two primary choices. nginx and lighttpd.</p>
<p>One of them is needlessly inflexible and complex, the other is simple and flexible but is being ruined by community-related issues. Which should I pick? How does one pick between semantical hell and a school yard?</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2009/10/16/new-vps-and-the-troubles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing software on ESX 3.5i</title>
		<link>http://nixy.dk/2008/08/14/installing-software-on-esx-35i/</link>
		<comments>http://nixy.dk/2008/08/14/installing-software-on-esx-35i/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 18:31:52 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[vmware]]></category>
		<category><![CDATA[busybox]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nixy.dk/?p=18</guid>
		<description><![CDATA[A lot of people have posted guides to enable ssh access to ESXi servers, but what now?
I&#8217;m currently trying to figure out how to install additional software on ESXi. This is a bit of a tough one for now.
My findings are as follows:

There are two vmfs file systems which contain a set of .tgz files. [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people have posted guides to enable ssh access to ESXi servers, but what now?</p>
<p>I&#8217;m currently trying to figure out how to install additional software on ESXi. This is a bit of a tough one for now.</p>
<p>My findings are as follows:</p>
<ul>
<li>There are two vmfs file systems which contain a set of .tgz files. The contents are identical, but with the hash sums do not match</li>
<li>One of these file system trees contain a checksum.md5 file. The other does not &#8211; I suppose that the one with the checksums is what ESXi considers as being the &#8220;original&#8221; files.</li>
<li>When I replaced /lib/libc.so.6 on the server, it immediately dropped all my ssh sessions, and denied access to the console. Once I power cycled the server, all the changes I made to the userland and base of the OS were reverted (I&#8217;m guessing they came from the &#8220;recovery&#8221; file system)</li>
<li>ESXi complains if the libraries in use do not have a VMWARE_SOMETHING version string (And thus the previously described scenario occurs)</li>
<li>Most of the userland consists of busybox and dropbear sshd. There&#8217;s also gpg.</li>
</ul>
<p>I&#8217;m not big on building software, the usage of gcc, or anything related to linux for that matter, so help from some linux guru on this matter would be greatly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2008/08/14/installing-software-on-esx-35i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serious issue: Change loader logo in FreeBSD 6+</title>
		<link>http://nixy.dk/2008/03/20/serious-issue-change-loader-logo-in-freebsd-6/</link>
		<comments>http://nixy.dk/2008/03/20/serious-issue-change-loader-logo-in-freebsd-6/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 18:00:30 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[appearance]]></category>
		<category><![CDATA[beastie]]></category>
		<category><![CDATA[logo]]></category>

		<guid isPermaLink="false">http://nixy.dk/2008/03/20/serious-issue-change-loader-logo-in-freebsd-6/</guid>
		<description><![CDATA[Now, ever since the new FreeBSD logo was concieved, we have had to deal with the cumbersome &#8220;Free BSD&#8221; ascii art on our boot screens.
But not anymore! In one of my general fits of boredom, I went into /boot/ and had a look through the files. Always remember to familiarize yourself with your operating system, [...]]]></description>
			<content:encoded><![CDATA[<p>Now, ever since the new FreeBSD logo was concieved, we have had to deal with the cumbersome &#8220;Free BSD&#8221; ascii art on our boot screens.</p>
<p>But not anymore! In one of my general fits of boredom, I went into <code>/boot/</code> and had a look through the files. Always remember to familiarize yourself with your operating system, even if you&#8217;ve been running it for ages.</p>
<p>In <code>/boot/beastie.4th</code>, there&#8217;s some ascii art. One looks like a colored beastie, the other like a monotone beastie, and a third is the ASCII art text.  Now, shouldn&#8217;t there be some configuration switch to change this behaviour as it fits us? Sure thing!</p>
<p>Just grep <code>/boot/defaults/loader.conf</code> after &#8220;logo&#8221;. <code>grep logo /boot/defaults/loader.conf</code>, and voilá!</p>
<pre>[alive@p0rnteddy /boot]$ grep logo defaults/loader.conf
#loader_logo="fbsdbw"           # Desired logo: fbsdbw, beastiebw, beastie, none</pre>
<p>See, you can even remove the logo altogether, or hack the <code>beastie.4th</code> file to include your own. Just remember to make sure it fits on the screen &#8211; I don&#8217;t even know what would happen if it didn&#8217;t; Haven&#8217;t been stupid enough to test.</p>
<p>Anyway, the colored beastie, while a nice feature, requires tweaking &#8211; as it looks ugly to my eyes. Open up your <code>/boot/loader.conf</code> and write <code>loader_logo="beastiebw"</code>.</p>
<p>Reboot your system and enjoy the sight.</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2008/03/20/serious-issue-change-loader-logo-in-freebsd-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare-server 8-char bug</title>
		<link>http://nixy.dk/2008/01/20/vmware-8-char-bug/</link>
		<comments>http://nixy.dk/2008/01/20/vmware-8-char-bug/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 11:41:29 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[8021q]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://nixy.dk/2008/01/20/vmware-8-char-bug/</guid>
		<description><![CDATA[VMWare-server has a bug that doesn&#8217;t allow network interface device names to be more than 8 characters long. Yes, this is not a typo: If your interface name is more than 8 characters long, you&#8217;re out of luck.
The origin of the bug for me is unknown. Naturally, I&#8217;ve had to research this issue as it [...]]]></description>
			<content:encoded><![CDATA[<p>VMWare-server has a bug that doesn&#8217;t allow network interface device names to be more than 8 characters long. Yes, this is not a typo: If your interface name is more than 8 characters long, you&#8217;re out of luck.</p>
<p>The origin of the bug for me is unknown. Naturally, I&#8217;ve had to research this issue as it became apparent to me when I had to set up two network interfaces in bonding (Thus calling them bond0) and then putting this new virtual interface into work with two 8021q vlan&#8217;s (Thus calling them bond0.100 and bond0.101). Now, I do realize that having a 9-character long interface name is a bit on the side of the unusual, but rarely you&#8217;d spot any software which supports any less than 255 characters, right? I mean, this is just common sense these days. Pretending to hunt for bits of RAM by shaving off something like 248 bytes just SO belongs back in 1980&#8217;s computing. Not fixing this bug from version 1.0.0 to version 1.0.4 of your software belongs back at Microsoft. Not having a part of your website dedicated to bug reports belongs back in FAIL.</p>
<p>Anyway, this is not an opinion piece.</p>
<p>After spending a good part of  a weeks worth of office time hunting down this bug, I finally decided to trace back my steps and see if there was something I could do to solve this problem.</p>
<p>When creating vlans on an interface in Linux, you usually use a tool called vconfig. Turns out that vconfig had the option to provide a custom naming scheme. Just run <code>vconfig set_name_type VLAN_PLUS_VID_NO_PAD</code> and you&#8217;re golden. Now your interface name is called vlan100 or something similar.</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2008/01/20/vmware-8-char-bug/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Updated site</title>
		<link>http://nixy.dk/2007/10/28/updated-site/</link>
		<comments>http://nixy.dk/2007/10/28/updated-site/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 15:44:12 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[meta]]></category>
		<category><![CDATA[nixy]]></category>

		<guid isPermaLink="false">http://nixy.dk/2007/10/28/updated-site/</guid>
		<description><![CDATA[The old layout I was using was awesome, but it didn&#8217;t support widgets in the menu, so instead of editing a lot of html and css, I decided that I could just use an other theme.
Isn&#8217;t this awesome? Now I also have ads, so that I can some time move this blog out of my [...]]]></description>
			<content:encoded><![CDATA[<p>The old layout I was using was awesome, but it didn&#8217;t support widgets in the menu, so instead of editing a lot of html and css, I decided that I could just use an other theme.</p>
<p>Isn&#8217;t this awesome? Now I also have ads, so that I can some time move this blog out of my closet and into a co-location datacenter.</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2007/10/28/updated-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickpost: RTC problems in Debian on Dell PowerEdge servers</title>
		<link>http://nixy.dk/2007/10/24/quickpost-rtc-problems-in-debian-on-dell-poweredge-servers/</link>
		<comments>http://nixy.dk/2007/10/24/quickpost-rtc-problems-in-debian-on-dell-poweredge-servers/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 13:21:37 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[hpet]]></category>
		<category><![CDATA[hwclock]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[rtc]]></category>

		<guid isPermaLink="false">http://nixy.dk/2007/10/24/quickpost-rtc-problems-in-debian-on-dell-poweredge-servers/</guid>
		<description><![CDATA[I&#8217;ve had some problems with RTC on Dell PowerEdge servers with Debian 4.0 (etch), which were unfixable by all of the following:

Set Hz to 100/250/1000
Try newer kernel
Add &#8211;directisa option to hwclock (Would only fix a symptom of the problem, and not touch the problem itself at all)

The symptoms:
You get a lot of messages like this:
rtc: [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had some problems with RTC on Dell PowerEdge servers with Debian 4.0 (etch), which were unfixable by all of the following:</p>
<ul>
<li>Set Hz to 100/250/1000</li>
<li>Try newer kernel</li>
<li>Add &#8211;directisa option to hwclock (Would only fix a symptom of the problem, and not touch the problem itself at all)</li>
</ul>
<p>The symptoms:<br />
You get a lot of messages like this:<br />
<code>rtc: lost some interrupts at 2048Hz</code><br />
This varies (in my case) between 1024Hz, 2048Hz and 4096Hz. The message is printed to the terminal as fast as it can handle, and is written to syslog at a rate of 3500/sec &#8211; Though some times less.<br />
If you run &#8220;hwclock&#8221; on the system, it spits out an error message:<br />
<code>select() to /dev/rtc to wait for clock tick timed out</code>.</p>
<p><a href="http://chxo.com/be2/20060821_3333.html">Chris Snyder</a> suggests to avoid the problem instead of fixing it, by disabling precise timekeeping in VMware (Which is what was my main problem). What did fix the problem, however, was to compile a new kernel with HPET_EMULATE_RTC. This is more or less a battle in itself, as HPET_EMULATE_RTC depends on other stuff on its own. I&#8217;m to exhausted to give a proper walkthrough on this, as I&#8217;ve done about 50 kernel recompiles in the past week or so, and just want to forget this issue altogether ASAP.</p>
<p>Why HPET_EMULATE_RTC isn&#8217;t on by default is beyond my scope of comprehension, as there&#8217;s absolutely no good reason to not have it enabled unless you&#8217;re running an extremely small embedded kernel which doesn&#8217;t need it in the first place, in which case you&#8217;ll disabe it forcefully anyway.</p>
<p><strong>Update:</strong> After notifying Chris about this blog post, he suggested that I update it with the kernel config options that I enabled to make HPET RTC emulation work. As opposed to what I wrote earlier, there&#8217;s not really hundreds of different .config options to edit. Only a few if you&#8217;re editing .config directly and only one if you&#8217;re using menuconf.</p>
<p>In menuconf, go <code>Device Drivers ---&gt; Character Devices ---&gt; Enchanced Real Time Clock Support</code>. You&#8217;ll see that it is built as a module. What we really need is to make it built-in. Just press Y. Now you can type / (slash) and search for HPET. Go to the bottom of the search results and you should hopefully see HPET_EMULATE_RTC=y.<br />
For all the others, here&#8217;s the diff for the Debian 2.6.18 kernel:</p>
<pre>147d146
&lt; CONFIG_HPET_EMULATE_RTC=y
2140c2139,2141
&lt; CONFIG_RTC=y
---
&gt; CONFIG_RTC=m
&gt; CONFIG_GEN_RTC=m
&gt; CONFIG_GEN_RTC_X=y</pre>
<p>Please note, CONFIG_HPET_EMULATE_RTC depends on CONFIG_RTC=y.</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2007/10/24/quickpost-rtc-problems-in-debian-on-dell-poweredge-servers/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Using daemontools (supervise) on FreeBSD</title>
		<link>http://nixy.dk/2007/10/22/using-daemontools-supervise-on-freebsd/</link>
		<comments>http://nixy.dk/2007/10/22/using-daemontools-supervise-on-freebsd/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 21:20:34 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[supervise]]></category>
		<category><![CDATA[daemontools]]></category>
		<category><![CDATA[svscan]]></category>

		<guid isPermaLink="false">http://nixy.dk/2007/10/22/using-daemontools-supervise-on-freebsd/</guid>
		<description><![CDATA[What is daemontools?
From the daemontools website:
 daemontools is a collection of tools for managing UNIX services.
supervise monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all supervise needs is a directory with a run script that runs the service.
At first when I was [...]]]></description>
			<content:encoded><![CDATA[<p>What is daemontools?</p>
<p>From the <a href="http://cr.yp.to/daemontools.html" title="daemontools">daemontools website</a>:</p>
<blockquote><p> daemontools is a collection of tools for managing UNIX services.</p>
<p><tt>supervise</tt> monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all <tt>supervise</tt> needs is a directory with a <tt>run</tt> script that runs the service.</p></blockquote>
<p>At first when I was introduced to this tool at work, I thought &#8220;What a typical Linux-admin. FreeBSD&#8217;s rc. system is superior.&#8221; Despite my personal preferences, whatever software is used at work is what I have to use and learn to use, too. After getting a little more familiar with supervise, and installing it on a FreeBSD server, I was finally convinced that this may also have a place on FreeBSD machines.</p>
<p>Have you ever needed to know that a process is 100% sure to be running no matter what? Well, some of our applications need that extra little safety net, and you might too. Just right of the bat I can mention things like httpd, sshd, <a href="http://nixy.dk/2007/10/12/denyhosts-on-freebsd-62/" title="DenyHosts on FreeBSD 6.2">denyhosts</a>, and syslog(-ng). While the theoretical risk of these applications crashing randomly and still being able to run again without any direct editing of some configuration file seems to be very low, in a production environment where loads are extremely high and all processes are pushed into a stage where their theoretical load-handling capacity is on the edge with what has practically been tested, this may happen to you &#8211; and you can&#8217;t afford the service being down until you figure out a way to fix it permanently.</p>
<p>Either way, if some application crashes in a recoverable manner, it&#8217;s most likely that either 1) supervise is still running and will try to revive the process or 2) your box is so broken, it doesn&#8217;t even matter that supervise is still running. It&#8217;s all about that extra little factor of reliability.</p>
<p>Convinced? Here&#8217;s the walkthrough:<br />
install <code>sysutils/daemontools</code>. When the configure page pops up, make sure to let it install the manpages, but leave out SIGQ12 if you don&#8217;t know what it is or don&#8217;t need it. After installing, edit the file <code>/usr/local/etc/rc.d/svscan.sh</code>. For some odd reason, daemontools doesn&#8217;t have a separate configuration file, so you&#8217;ll have to edit all options right here. The comments say that you should edit <code>/etc/rc.conf.d/svscan</code>, but that is probably some oddball Linux-specific thing, and no such directory exists in FreeBSD.  Have a quick look through the first lines of the file, and edit any settings that are specific to your setup. Either way, uncomment the (MIN|MAX)* lines, and the ulimits.  The next important thing to note, is the svscan_servicedir variable. Unless you have a really good reason to edit this, don&#8217;t.</p>
<p>Before starting svscan, we need to create the services dir and a service for it to start. If you didn&#8217;t edit the servicedir variable, you should just <code>mkdir /var/service</code>. Okay, what now?<br />
Imagine a scenario where you have a development server with two NICs. One internal, one external. On the external NIC, you want to be running with &#8220;PermitRootLogin no&#8221;, because any sane sysadmin wouldn&#8217;t allow root logins from random people on the internet. On the other hand, you have twenty developers who need to share this server &#8211; And you want to let them create their own accounts on the server as they wish, without disturbing anybody else, so you also want to run PermitRootLogin set to &#8220;yes&#8221; on the internal NIC.<br />
This might sound crazy, because obviously, it&#8217;s impossible to have the two at the same time. You have to only pick one configuration or make a very dirty hack, right? Incorrect. We can do this cleanly with supervise.</p>
<p>This one is one of the more complicated setups, just so you&#8217;ll have an idea of which conveniences supervise can provide, other than auto-starting crashed daemons.</p>
<p><code>cd /var/service &amp;&amp; mkdir sshdint sshdext; \<br />
cp /etc/ssh/sshd_config sshint/; cp /etc/ssh/sshd_config sshext/</code><br />
What we&#8217;ve done now, is to create to service directories for each instance of the ssh daemon we want to run, and copy over the system-wide configuration file. Now go edit the sshd_config in sshdint to allow root logins and listen on the internal IP, and the one in sshdext to deny them and listen on the external IP.</p>
<p>sshdint/sshd_config:</p>
<pre># You can only have one sshd instance listening on any one given IP.
ListenAddress [internal ip]

# For the internal IP, enable root logins.
PermitRootLogin yes

# It's important to have a different pid file for each daemon.
# Otherwise the universe will collapse.
PidFile /var/run/sshdint.pid</pre>
<p>sshdext/sshd_config:<br />
<code>ListenAddress [external ip]<br />
PermitRootLogin no<br />
PidFile /var/run/sshdext.pid</code></p>
<p>Edit other configuration settings as you wish. For example, it could maybe be a good idea to have the external sshd listen to a non-default port if you don&#8217;t want to run DenyHosts. But that&#8217;s beyond the scope of this article. You&#8217;ll be able to experiment with that by yourself once you&#8217;re done with this article.</p>
<p>Now, create the <code>run</code> scripts for each sshd.</p>
<p>Create <code>/var/service/(sshdint|sshdext)/run</code>, and edit them.</p>
<p>sshdint/run:<br />
<code>#!/bin/sh<br />
/usr/sbin/sshd -Df /var/service/sshdint/sshd_config</code></p>
<p>If you don&#8217;t specify the -D flag, sshd will detach and supervise will think that it&#8217;s down &#8211; so it&#8217;ll try to start the service again, for eternity.<br />
The other run file should contain the exact same content, except that &#8220;sshdint&#8221; should be &#8220;sshdext&#8221; in the path to the configuration file. Now, just <code>chmod u+x run</code> in each directory.</p>
<p>We&#8217;re almost done! For this next part, make sure you have direct access in the form of a screen and keyboard, as it&#8217;s very likely that you did a misconfiguration somewhere and that your sshd&#8217;s will all die.<br />
- Disable sshd in /etc/rc.conf<br />
- Enable svscan in /etc/rc.conf (svscan_enable=&#8221;YES&#8221;)</p>
<p><strong>Warning</strong>: Before proceeding, quadruple-double-triple-check that you&#8217;ve written everything correctly, that all the hard-coded paths exist, and that every little configuration is correct. You should even parse every script that you know will soon run in your head three times, before this next step. I can&#8217;t stress this enough. If you don&#8217;t have direct access to the box you&#8217;re playing with, either through a keyboard and screen or through a KVM swith, you&#8217;re 90% likely to lose all possible ways of interacting with this server once you execute the next step. Consider yourself warned. I don&#8217;t want any complaints in my comments about misconfigurations on your part.</p>
<p>- Run <code>/usr/local/etc/rc.d/svscan start</code><br />
If it starts correctly, it will now try to spawn two instances of sshd,  but they&#8217;ll both fail at starting up because you&#8217;ve got one system-wide sshd running, which is bound to all network interfaces on your system by default. If everything seems to be right, you should now see svscan running (<code>ps ax|grep svscan</code>) and you should get a lot of errors in <code>/var/log/messages</code> about sshd&#8217;s not being able to bind to any address. Now you can:<br />
- Stop sshd. <code>/etc/rc.d/sshd stop</code>.</p>
<p>You should now have two working sshd&#8217;s each listening on their own port. If you still get error messages in your messages log, you can either <code>killall -9 sshd</code> or just cleanly reboot the system.</p>
<p>Right now it&#8217;s late and my girlfriend is getting grumpy, so I&#8217;ll just leave this article open-ended (for now), but following things are to be aware of:<br />
- I think the sshd&#8217;s are trying to generate new certificates each time they are restarted (Although I&#8217;m absolutely not sure). This can easily be fixed by assigning each sshd it&#8217;s own set of certificates and making the appropriate changes in each sshd configuration file.<br />
- I wrote this article as I was doing the dual-sshd setup for the first time in my life, not even knowing if it will eventually work, so a lot of errors may occur, and I probably forgot to write a lot of important notes and things to consider.<br />
- You will not be able to ssh to localhost after this, because you no longer have a sshd listening on the loopback interface. Optionally, you could run an extra instance of sshd if you really need to ssh to localhost.<br />
- The dual-sshd setup is also achievable without daemontools, but not as cleanly as here.</p>
<p>Enjoy your new supervise setup :)</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2007/10/22/using-daemontools-supervise-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DenyHosts on FreeBSD 6.2</title>
		<link>http://nixy.dk/2007/10/12/denyhosts-on-freebsd-62/</link>
		<comments>http://nixy.dk/2007/10/12/denyhosts-on-freebsd-62/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 22:05:41 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[DenyHosts]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://nixy.dk/2007/10/12/denyhosts-on-freebsd-62/</guid>
		<description><![CDATA[If you run a nix server for a little while, you&#8217;ll notice that bots will try to gain illegitimate access to your server through ssh. While this unsettles a lot of people, there&#8217;s really nothing to worry about as long as you don&#8217;t permit root logins (Many Linux distributions allow direct root login via ssh [...]]]></description>
			<content:encoded><![CDATA[<p>If you run a nix server for a little while, you&#8217;ll notice that bots will try to gain illegitimate access to your server through ssh. While this unsettles a lot of people, there&#8217;s really nothing to worry about as long as you don&#8217;t permit root logins (Many Linux distributions allow direct root login via ssh by default) and have a strong password policy.</p>
<p>Nonetheless, taking just an extra measure of security is a good idea, and this is where <a href="http://denyhosts.sourceforge.net/" title="DenyHosts" target="_blank">DenyHosts</a> comes into the picture. DenyHosts is a small Python script which makes password-guessing on your OpenSSH deployments virtually impossible, by allowing only a limited number of login attempts to your sshd. After a set  number of tries, DenyHosts simply denies the given IP further attempts. What&#8217;s even cooler about DenyHosts, is that the most recent version (2.0) allows you to benefit from over <a href="http://stats.denyhosts.net/stats.html" title="DenyHosts Statistical Summary" target="_blank">23.400 other peoples ban lists</a>, thus meaning you&#8217;re saving yourself a lot of worrying about those pesky login attempts. An added bonus is that you&#8217;ll save yourself a few kB&#8217;s of network traffic and a few CPU cycles by straight-out denying any previous offenders a connection to your server. :)</p>
<p>Other people might just want to save themselves the trouble, and move their sshd to a <a href="http://www.freebsddiary.org/ssh-higher-port.php" title="Putting sshd on a higher port">different port</a>. I believe that this solution is just security through obscurity, and is dangerous in the way that it gives a false sense of security to the admin. I disagree with that kind of solution, as you might notice if you look at the <a href="http://www.freebsddiary.org/phorum/read.php?f=3&amp;i=1492&amp;t=1492&amp;article_id=611" title="Security through obscurity">comments</a> the article in question has generated. (Please notice that even though I disagree with his method of avoiding sshd bots, I deeply respect the work that Dan is putting into The FreeBSD Diary.)</p>
<p>DenyHosts depends on Python, which you have to make sure you want to have on your server. Python isn&#8217;t such a bad thing to have &#8211; but porting DenyHosts to sh would certainly reduce the amount of CPU cycles needed, and of course, remove Python as a dependency for those who don&#8217;t want to bloat their server.</p>
<p>So let&#8217;s get started, shall we?</p>
<p>First, make sure that you&#8217;ve got the updated ports tree (Use portsnap) and install the <code>security/denyhosts</code> port. If you&#8217;ve already got Python, this should only take a few seconds, as nothing needs to be compiled.</p>
<p>Once installed, DenyHosts gives you a lot of info about how to configure it, but I&#8217;ll repeat it just in case.</p>
<p>Open /etc/rc.conf, add the lines<br />
<code>denyhosts_enable="YES"<br />
syslogd_flags="-c"</code><br />
The first line ensures that DenyHosts starts at boot time. The second line makes sure that syslogd does not group repeated log messages, so that they appear as &#8220;Last line repeated 23234 times&#8221; &#8211; This makes it possible for DenyHosts to actually count how many login attempts any given hosts has made.</p>
<p>Now edit /etc/hosts.allow and add the lines<br />
<code>sshd :  /etc/hosts.deniedssh : deny<br />
sshd : ALL : allow</code><br />
This will ensure that the hosts.allow mechanism in FreeBSD denies connections to your sshd from any of the hosts listed in hosts.deniedssh, and allows all other connections. The last line parsed is authoritative, so in theory if you add an IP to the block list in hosts.deniedssh, and allow the same IP later in the parsing process, the host will be allowed to connect.</p>
<p>Before we go further, we need to make sure that the hosts.deniedssh file exists and has the correct permissions:<br />
<code>touch hosts.deniedssh<br />
chmod 644 hosts.deniedssh<br />
chown root:wheel hosts.deniedssh</code></p>
<p>Almost there. For good measure, we should probably edit the <code>/usr/local/etc/denyhosts.conf</code>. If it&#8217;s not there, copy over denyhosts.conf-dist to denyhosts.conf, and fire up your favorite editor.<br />
Make sure to read every single line of the sample configuration file, and adjust the settings to whatever fits your system and preferences. The most vital options here are the:</p>
<ul>
<li><code>SECURE_LOG</code>, which should be /var/log/auth.log, just in case the &#8220;Mandrake, FreeBSD or OpenBSD&#8221; comment right above it confused you</li>
<li><code>HOSTS_DENY</code>, should be set to /etc/hosts.deniedssh just in case you forgot which file you were creating a second ago</li>
</ul>
<p>All of the timing and recurrency options are quite sane defaults, so I&#8217;d recommend you not to touch them unless you either know what you&#8217;re doing, or if you&#8217;re very picky about these kinds of things.</p>
<p>Now you should have a nicely working DenyHosts installation, but wait, remember the 23.400 people who are contributing to the DenyHosts lists? Why not be a part of this amazing network? All it requires, is that you enable the synchronization feature. Just uncomment the <code>SYNC_SERVER</code> variable, and synchronization will work fine.</p>
<p>The reason why synchronization isn&#8217;t enabled by default even though it&#8217;s the optimal setting for the vast majority of installations, is because synchronization poses a <em>theoretical</em> security risk, and a <em>theoretical</em> privacy risk.</p>
<p>The security risk is &#8211; as I said &#8211; purely theoretical, as if some evil hacker was to be pissed off by all these people who are not responding to his ssh-bots, and should decide to hack the denyhosts synchronization server, he could send malicious code to all synchronizing DenyHosts clients. Remember, though, that this risk is as improbable as the sky falling down on our heads, and that anybody can buy a license to use the synchronization server for use in their private network. You could also reverse engineer the synchronization protocol that DenyHosts uses and make your own synchronization server &#8211; But then again, this entire paragraph consists solely of theoretical possibilities.</p>
<p>All that&#8217;s left to done is to restart the system (To make sure syslogd starts with the -c flag) and to make sure DenyHosts has started at boot time.<br />
<code>ps -ax|grep  denyhosts</code><br />
If you enabled synchronization, you can also watch as DenyHosts fills up the hosts.deniedssh file with lots and lots of persistent sshd-brute forcing zombies. Dare to cat it?</p>
<p>Enjoy your new non-obscurely secured sshd!</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2007/10/12/denyhosts-on-freebsd-62/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Using PuTTy on Windows</title>
		<link>http://nixy.dk/2007/10/10/using-putty-on-windows/</link>
		<comments>http://nixy.dk/2007/10/10/using-putty-on-windows/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 21:48:08 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[Putty]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://nixy.dienub.org/2007/10/10/using-putty-on-windows/</guid>
		<description><![CDATA[A tip for maximizing your efficiency with PuTTy on Windows.
I use Windows XP on my desktop workstations at home (Because I&#8217;m lazy) and at work (Because I have to), so my primary way of interfacing with Unix servers is through PuTTy and it&#8217;s tools. I have at least one terminal window open at any time [...]]]></description>
			<content:encoded><![CDATA[<p>A tip for maximizing your efficiency with <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" title="PuTTY: A Free Telnet/SSH Client">PuTTy</a> on Windows.</p>
<p>I use Windows XP on my desktop workstations at home (Because I&#8217;m lazy) and at work (Because I have to), so my primary way of interfacing with Unix servers is through PuTTy and it&#8217;s tools. I have at least one terminal window open at any time of the day, so you may say that PuTTy is my most frequently used application ever. During the course of using PuTTy, I&#8217;ve been fed up with having to double-click on the putty icon, type the server name, then type my user name and then password. There has to be a more efficient way, I thought.</p>
<p>After experimenting a bit, I realized that putty takes roughly the same command line arguments as your run-of-the-mill ssh client on *nix, so I set it up to be as fast as when invoking ssh in a command line. Here is how you take advantage of that.</p>
<p><strong>Walkthrough: </strong></p>
<p>First, we&#8217;re going to set up your $PATH in Windows so that you can exec binaries from the PuTTY install directory.</p>
<ol>
<li> Left-click on My Computer</li>
<li>Select &#8220;Properties&#8221;</li>
<li>Go to the &#8220;Advanced&#8221; tab</li>
<li>Click &#8220;Environment Variables&#8221; button</li>
<li>Scroll down to &#8220;Path&#8221; variable in &#8220;System Variables&#8221; field</li>
<li>Double-click &#8220;Path&#8221; variable</li>
<li>Append your PuTTy install directory to the &#8220;Variable value&#8221; field, for example &#8220;;C:\Program Files\PuTTy&#8221; to the end of the line. Remember the colon first &#8211; It&#8217;s important. There&#8217;s probably a better way of doing this, but I&#8217;ll correct that later.</li>
<li>Apply settings, get back to desktop.</li>
</ol>
<p>Now we&#8217;re done with all of the configuration. What we&#8217;ve done, is to add the putty install directory to the places where Windows searches for executable files when you invoke them by name alone. This principle is exactly the same as in any *nix, except that Microsoft somehow decided a GUI was a good way to do this.</p>
<p>The whole point of this article is that the way I launch putty on my system, is type WIN+R and write &#8220;putty username@server.tld&#8221;. Now all that is needed for me, is to type my password &#8211; or gain instant access if I&#8217;m using key-based authentication (More about that in a later post).</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2007/10/10/using-putty-on-windows/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>nixy: Nix is sexy</title>
		<link>http://nixy.dk/2007/10/10/nixy-nix-is-sexy/</link>
		<comments>http://nixy.dk/2007/10/10/nixy-nix-is-sexy/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 21:26:38 +0000</pubDate>
		<dc:creator>Rada</dc:creator>
				<category><![CDATA[meta]]></category>
		<category><![CDATA[first post]]></category>
		<category><![CDATA[nixy]]></category>

		<guid isPermaLink="false">http://nixy.dienub.org/2007/10/10/nixy-nix-is-sexy/</guid>
		<description><![CDATA[Welcome to my latest brainchild.
Nixy.dk will be a blog about general Unix tips, and to some degree, FreeBSD-specific stuff.
First nixy post ETA 30min.
]]></description>
			<content:encoded><![CDATA[<p>Welcome to my latest brainchild.</p>
<p>Nixy.dk will be a blog about general Unix tips, and to some degree, FreeBSD-specific stuff.</p>
<p>First nixy post ETA 30min.</p>
]]></content:encoded>
			<wfw:commentRss>http://nixy.dk/2007/10/10/nixy-nix-is-sexy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->