<?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>treibsand.com &#187; FreeBSD</title>
	<atom:link href="http://www.treibsand.com/tag/freebsd/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.treibsand.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Dec 2011 12:46:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>FreeBSD Installation mit System Mirror und ZFS Raid</title>
		<link>http://www.treibsand.com/2011/02/16/freebsd-installation-mit-system-mirror-und-zfs-raid/</link>
		<comments>http://www.treibsand.com/2011/02/16/freebsd-installation-mit-system-mirror-und-zfs-raid/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 13:28:34 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=617</guid>
		<description><![CDATA[In meinem letzten Posting habe ich ja geschrieben, dass ich mir den HP Microserver angeschafft habe. Nun geht es um die Installation von FreeBSD, bei welcher das System selber über alle Festplatten gespiegelt und der restliche Plattenplatz als ZFS Raid genutzt wird. Bestückt ist der Server mit 4x 500GB SATA Festplatten (ad4,ad6,ad8 und ad10). Auf [...]]]></description>
			<content:encoded><![CDATA[<p>In meinem letzten Posting habe ich ja geschrieben, dass ich mir den HP Microserver angeschafft habe. Nun geht es um die Installation von FreeBSD, bei welcher das System selber über alle Festplatten gespiegelt und der restliche Plattenplatz als ZFS Raid genutzt wird.</p>
<p><span id="more-617"></span></p>
<p>Bestückt ist der Server mit 4x 500GB SATA Festplatten (ad4,ad6,ad8 und ad10). Auf jeder Festplatte werden 3 Partitionen angelegt, einmal 25GB für das Betriebssystem, 1GB Swap und der Rest für ZFS. </p>
<p>Nachdem von der FreeBSD CD (ich verwende 8.1 amd64) gebootet wurde und sysinstall gestartet ist, kann die normale Installation gestartet werden. Sobald man bei der Partitionierung ist müssen die Platten wie folgt aufgeteilt werden:</p>
<ol>
<li>die Platte (ad4) auswählen</li>
<li>Eine Partition mit 25000M erstellen, mit dem Typ 165</li>
<li>Eine Partition mit 1000M erstellen, ebenfalls Typ 165</li>
<li>Eine Partition mit restlich verfügbaren Platz erstellen, auch Typ 165</li>
<li>Partitions Manager mit q verlassen</li>
<li>BootMgr als Boot Manager auswählen (nicht Standard!)</li>
<li>Die obigen Schritte 2-6 nun nochmal für die restlichen Platten (ad6, ad8 und ad10) ausführen</li>
</ol>
<p>Als nächstes können die Slices angelegt werden.</p>
<ol>
<li>Ein Slice in ad4s2, ad6s2, ad8s2 und ad10s2 anlegen und als Swap definieren</li>
<li>Ein Slice mit 1024M in ad4s1 anlegen und als Mountpoint / setzen</li>
<li>Ein Slice mit 1024M in ad4s1 anlegen und als Mountpoint /tmp setzen</li>
<li>Ein Slice mit 2048M in ad4s1 anlegen und als Mountpoint /var setzen</li>
<li>Ein Slice mit dem restlich verfügbaren Platz anlegen und als Mountpoint /usr setzen</li>
</ol>
<p>Es müssen keine weiteren Slices für die anderen Partitionen angelegt werden. Es nur wichtig, dass bei alle Platten adXs2 als Swap definiert wurde. Anschließend kann die Installation normal durchgeführt werden und das System mit sysinstall konfiguriert werden.</p>
<p>Sobald die Installation abgeschlossen ist, kann rebootet werden, allerdings muss wieder von der CD gebootet werden, damit die gmirror Konfiguration vorgenommen werden kann. Wenn die CD gebootet ist, FixIt in sysinstall auswählen und die Shell von CD starten.</p>
<p>In der Shell muss zuerst ein Symlink angelegt werden, damit gmirror in der Shell von CD funktioniert.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>kernel <span style="color: #000000; font-weight: bold;">/</span>boot</pre></div></div>

<p>Danach kann gmirror geladen und initialisiert werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gmirror load
gmirror label <span style="color: #660033;">-v</span> gm0s1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ad4s1</pre></div></div>

<p>Damit FreeBSD den Mirror beim Booten verwendet muss dies noch eingetragen werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mirror<span style="color: #000000; font-weight: bold;">/</span>gm0s1a <span style="color: #000000; font-weight: bold;">/</span>mnt
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">geom_mirror_load</span>=<span style="color: #ff0000;">&quot;YES&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>loader.conf</pre></div></div>

<p>Schließlich muss noch die Datei <strong>/mnt/etc/fstab</strong> angepasst werden, dort stehen diese noch mit <strong>ad4</strong> drin. Dort muss jeder Eintrag mit <strong>/dev/ad4s1X</strong> zu <strong>/dev/mirror/gm0s1X</strong> geändert werden. </p>
<p>Jetzt kann der Rechner direkt von der Festplatte gebootet werden. Sobald das System hochgefahren ist, können die anderen Platten in den Mirror eingehängt werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gmirror insert gm0s1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ad6s1
gmirror insert gm0s1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ad8s1
gmirror insert gm0s1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ad10s1
gmirror status</pre></div></div>

<p> Es kann jetzt ein paar Minuten dauern, bis <strong>gmirror status</strong> angibt, dass Platten gespiegelt sind. Sobald das erledigt ist, können wir uns um ZFS kümmern.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">zfs_enable</span>=<span style="color: #ff0000;">&quot;YES&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.conf</pre></div></div>

<p>Dadurch wird ZFS beim Starten aktiviert. Jetzt kann ein ZFS Raid Pool angelegt werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">zpool create tank raidz ad4s3 ad6s3 ad8s3 ad10s3</pre></div></div>

<p>Nach der Erstellung des Pools können die einzelnen Mountpoints angelegt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">zfs create tank<span style="color: #000000; font-weight: bold;">/</span>home
zfs create tank<span style="color: #000000; font-weight: bold;">/</span>stuff</pre></div></div>

<p>Soll z.B. der Mountpoint tank/stuff komprimiert werden, dann kann dies wie folgt gemacht werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">zfs <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">compression</span>=<span style="color: #c20cb9; font-weight: bold;">gzip</span> tank<span style="color: #000000; font-weight: bold;">/</span>stuff</pre></div></div>

<p>Wenn z.B. die Home Verzeichnisse aus ZFS verwendet werden sollen, so können diese auch direkt unter /home gemountet werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">zfs <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">mountpoint</span>=<span style="color: #000000; font-weight: bold;">/</span>home tank<span style="color: #000000; font-weight: bold;">/</span>home</pre></div></div>

<p>Sobald alles abgeschlossen ist, hat man ein wunderbares FreeBSD System, welches redundant über alle Festplatten installiert ist <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2011/02/16/freebsd-installation-mit-system-mirror-und-zfs-raid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Es muss nicht immer Bind sein&#8230;</title>
		<link>http://www.treibsand.com/2009/02/20/maradns/</link>
		<comments>http://www.treibsand.com/2009/02/20/maradns/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 09:01:47 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Bind]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[FreeNAS]]></category>
		<category><![CDATA[MaraDNS]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=254</guid>
		<description><![CDATA[Die meisten Administratoren, welchen einen DNS Server aufsetzen wollen, denken automatisch an Bind. Klar, Bind ist ein hervorragender DNS Server, oft aber zu umfangreich für eine kleine Installation. Soll z.B. ein DNS Server auf einem extrem abgespecktem System, wie z.B. FreeNAS installiert werden, dann bietet sich eher was kleineres an&#8230; Genau das war vor kurzem [...]]]></description>
			<content:encoded><![CDATA[<p>Die meisten Administratoren, welchen einen DNS Server aufsetzen wollen, denken automatisch an Bind. Klar, Bind ist ein hervorragender DNS Server, oft aber zu umfangreich für eine kleine Installation. Soll z.B. ein DNS Server auf einem extrem abgespecktem System, wie z.B. <a href="http://www.freenas">FreeNAS</a> installiert werden, dann bietet sich eher was kleineres an&#8230;</p>
<p><span id="more-254"></span><br />
Genau das war vor kurzem bei mir der Fall, wo ich einen DNS Server in meiner FreeNAS Installation brauchte. Ich hab auch schon an <a href="http://tinydns.org">TinyDNS</a> von D.J. Bernstein gedacht, allerdings braucht dieser /usr/sbin/daemon, was bei mir nicht verfügbar ist.</p>
<p>Also viel meine Wahl auf <a href="http://www.maradns.org">MaraDNS</a>. Hierbei handelt es sich um einen extrem kleinen DNS Server, welcher seine Zonen aus CSV Dateien holt. Ziemlich einfach zu installieren bzw. konfigurieren.</p>
<p>Unter FreeBSD reicht ein <b>pkg_add -r maradns</b> und die Software ist installiert. Die Konfiguration in der Datei mararc ist auch recht simpel&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">csv2 = <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
csv2<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;example.com.&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">&quot;db.example.com&quot;</span>
csv2<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;0.168.192.in-addr.arpa.&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">&quot;db.192.168.0&quot;</span>
&nbsp;
ipv4_bind_addresses = <span style="color: #ff0000;">&quot;0.0.0.0&quot;</span>
chroot_dir = <span style="color: #ff0000;">&quot;/usr/local/etc/maradns&quot;</span>
maradns_uid = <span style="color: #000000;">53</span>
maradns_gid = <span style="color: #000000;">53</span>
maxprocs = <span style="color: #000000;">96</span>
no_fingerprint = <span style="color: #000000;">0</span>
default_rrany_set = <span style="color: #000000;">3</span>
max_chain = <span style="color: #000000;">8</span>
max_ar_chain = <span style="color: #000000;">1</span>
max_total = <span style="color: #000000;">20</span>
verbose_level = <span style="color: #000000;">1</span>
&nbsp;
ipv4_alias = <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>  = <span style="color: #ff0000;">&quot;198.41.0.4, 192.228.79.201, 192.33.4.12, 128.8.10.90,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;192.203.230.10, 192.5.5.241, 192.112.36.4,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;128.63.2.53, 192.36.148.17, 192.58.128.30,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;193.0.14.129, 198.32.64.12, 202.12.27.33&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>  = <span style="color: #ff0000;">&quot;157.238.46.24, 209.104.33.250, 209.104.63.249,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;130.94.168.216, 209.21.75.53, 64.114.34.119,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;207.6.128.246, 167.216.255.199, 62.208.181.95,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;216.87.153.98, 216.178.136.116&quot;</span>
&nbsp;
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;localhost&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">&quot;127.0.0.0/8&quot;</span>
recursive_acl = <span style="color: #ff0000;">&quot;localhost,192.168.0.0/8&quot;</span></pre></div></div>

<p>In der Konfiguration werden 2 Zonen eingerichtet, eine für example.com und eine Reverse Zone für 192.168.0. Ausserdem wird mit <b>recursive_acl</b> das Netz 192.168.0.0/8 für Abfragen freigeschalten.</p>
<p>Die Zonen an sich sind auch extrem einfach aufgebaut. Die Zone für example.com in der Datei db.exmaple.com</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server1.example.com. A 192.168.0.1
server1.exmaple.com. MX <span style="color: #000000;">10</span> server1.example.com.
server2.example.com. CNAME server1.example.com.
&nbsp;
client1 A 192.168.0.10
client2 A 192.168.0.11</pre></div></div>

<p>Die Datei db.192.168.0 für die Rückwärtsauflösung sieht dann z.B. wie folgt aus&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">1.0.168.192 PTR server1.example.com.
10.0.168.192 PTR client1.example.com.
11.0.168.192 PTR client2.example.com.</pre></div></div>

<p>Auch der Umstieg von Bind wird leicht gemacht. Mit dem Tool <b>getzone</b>, welches mitgeliefert wird, können direkt die Zonen von einem anderen Server geholt, und in das MaraDNS Format ausgegeben werden. Das erspart lästige Tipparbeit <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">getzone example.com 192.168.0.100</pre></div></div>

<p>Hier hole ich die Zone example.com von dem Nameserver mit der IP 192.168.0.100.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/02/20/maradns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD aktualisieren</title>
		<link>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/</link>
		<comments>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 18:43:25 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/</guid>
		<description><![CDATA[Jeder Administrator, welcher schon mal ein make world unter FreeBSD gemacht hat, weiss wie lange es dauert das System zu aktualisieren bzw. wie umständlich es ist. Hier hilft das Tool freebsd-update. Es handelt sich hierbei um ein Shell Script, welches seit FreeBSD 6.4 mitgeliefert wird. Mit diesem Script kann das ganze System (ausgenommen Ports natürlich) [...]]]></description>
			<content:encoded><![CDATA[<p>Jeder Administrator, welcher schon mal ein make world unter <a href="http://www.freebsd.org">FreeBSD</a> gemacht hat, weiss<br />
wie lange es dauert das System zu aktualisieren bzw. wie umständlich es ist. Hier hilft das Tool freebsd-update.</p>
<p><span id="more-175"></span><br />
Es handelt sich hierbei um ein Shell Script, welches seit FreeBSD 6.4 mitgeliefert wird. Mit diesem Script kann<br />
das ganze System (ausgenommen Ports natürlich) einfach geupdatet werden.</p>
<p>FreeBSD wird dabei nicht aus den Quellen neu gebaut, es werden Binaries verwendet, und hier wird auch nur<br />
die x86 Architektur bedient. Weitere Vorraussetzung ist, dass das System ein Release ist, also z.B. 7.1-RELEASE.<br />
Systeme, welche vorher mit make world geupdatet wurden kann freebsd-update nicht analysieren.</p>
<p>Um z.B. aktuelle Sicherheitsupdates zu installieren reicht:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update fetch
freebsd-update <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Darauf hin untersucht freebsd-update das System und sucht für dieses Release neue Updates. Diese werden<br />
dann installiert, sofern nötig muss der Rechner rebootet werden.</p>
<p>Soll das ganze System auf ein neues Release geupdatet werden, dann muss dieses explizit angegeben werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update <span style="color: #660033;">-r</span> <span style="color: #000000;">7.1</span>-RELEASE upgrade
freebsd-update <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Bei Release Updates muss der Rechner rebootet werden, da ein neuer GENERIC Kernel installiert wird. Sobald<br />
man allerdings einen selbst gebautet Kernel verwendet, wird das ganze etwas komplizierter. Dieser muss dann<br />
natürlich nochmal gegen die neuen Sourcen gebaut werden. freebsd-update weisst aber darauf hin. Nach einem Update auf ein neues Release muss man noch alle Ports gegen das neue Basissystem bauen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portupgrade <span style="color: #660033;">-af</span></pre></div></div>

<p>Hier hat es wieder der Admin einfach, welcher nur Packages verwendet <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Allgemein ist freebsd-update ein wunderbares Tool, um ein System relativ einfach aktuell zu halten. Vor kurzem<br />
hat es mir dabei geholfen, ein FreeBSd 6.2 auf 7.1 zu aktualisieren. Dabei kam es zu keinem Problem. Übrigens,<br />
mergemaster fällt mit freebsd-update auch weg <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brute Force Angriffe mit DenyHosts abwehren</title>
		<link>http://www.treibsand.com/2008/09/19/brute-force-angriffe-mit-denyhosts-abwehren/</link>
		<comments>http://www.treibsand.com/2008/09/19/brute-force-angriffe-mit-denyhosts-abwehren/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 16:07:46 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Sicherheit]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/?p=165</guid>
		<description><![CDATA[Viele Systemadministratoren kennen bestimmt das Problem, dass sehr viele Brute Force Angriffe gegen die eigenen Server laufen. Systematisch werden Logins mit den ueblichen Benutzernamen bzw. Passwörtern per SSH versucht. Genau hier hilft DenyHosts. Es handelt sich hierbei um einen kleinen Daemon, welcher permanent die Datei /var/auth.log liest und bei mehrmaligen fehlgeschlagenen Login Versuchen die IP [...]]]></description>
			<content:encoded><![CDATA[<p>Viele Systemadministratoren kennen bestimmt das Problem, dass sehr viele Brute Force Angriffe gegen die eigenen Server laufen. Systematisch werden Logins mit den ueblichen Benutzernamen bzw. Passwörtern per SSH versucht. </p>
<p><span id="more-165"></span><br />
Genau hier hilft DenyHosts. Es handelt sich hierbei um einen kleinen Daemon, welcher permanent die Datei /var/auth.log liest und bei mehrmaligen fehlgeschlagenen Login Versuchen die IP per /etc/hosts.allow blockt. Das Prinzip ist nicht neu, es gibt z.B. auch andere Tools, welche die gleiche Funktionalität z.B. per iptables lösen.</p>
<p>Das ist aber noch nicht alles, man kann den Daemon auch so einstellen, dass der die gefundenen IPs der globalen Datenbank von DenyHosts meldet. Im Gegenzug kann auch die Datenbank verwendet werden um die Hosts Datei zu füttern. Seit dem ich das Tool auf meinen Servern installiert habe, haben die Angriffe fast aufgehört bzw. es wurden fast alle sofort geblockt.</p>
<p>Die Konfiguration ist denkbar einfach. Nachdem die Software installiert ist, muss als erstes die Datei denyhosts.conf angepasst werden. Die Konfigurationsdatei ist ziemlich selbsterklärend. Danach kann auch schon der Daemon gestartet werden. Dank der Ports Collection von FreeBSD war das Startscript bereits vorhanden. Der Daemon schreibt seine Einträge dann üblicherweise in die Datei /etc/hosts.deniedssh, welche nur noch in die Datei /etc/hosts.allow eingebunden werden muss mit&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sshd : <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts.deniedssh : deny  
sshd : ALL : allow</pre></div></div>

<p>Danach ist das komplette System fertig konfiguriert und das System blockt automatisch SSH Anfragen von IPs, welche in der Datenbank von DenyHosts gelistet sind. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2008/09/19/brute-force-angriffe-mit-denyhosts-abwehren/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

