<?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>EmanuelDuss.ch.</title>
	<atom:link href="http://emanuelduss.ch/feed/" rel="self" type="application/rss+xml" />
	<link>http://emanuelduss.ch</link>
	<description>blog von @mindfuckup</description>
	<lastBuildDate>Thu, 26 Jan 2012 19:08:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eine WPA2 WLAN Verbindung herstellen mit wpa_supplicant</title>
		<link>http://emanuelduss.ch/2012/01/eine-wpa2-wlan-verbindung-herstellen-mit-wpa_supplicant/</link>
		<comments>http://emanuelduss.ch/2012/01/eine-wpa2-wlan-verbindung-herstellen-mit-wpa_supplicant/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 16:36:14 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[netzwerk]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=640</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2012/01/eine-wpa2-wlan-verbindung-herstellen-mit-wpa_supplicant/&amp;text=Eine WPA2 WLAN Verbindung herstellen mit wpa_supplicant&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Standardmässig verschlüsselt man heutzutage sein WLAN mit WPA2 PSK. Mit wpa_supplicant kann man sich an diesem WLAN authentifizieren. Die Konfigurationsdatei dafür wird mit wpa_passphrase generiert. WLAN Netzwerk finden Zuerst wird das WLAN-Interface aktiviert (in meinem Fall heisst das Interface wlan0): $ sudo ifconfig wlan0 up Dann scannt man nach verfügbaren Netzwerken: $ sudo iwlist wlan0 [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2012/01/eine-wpa2-wlan-verbindung-herstellen-mit-wpa_supplicant/&amp;text=Eine WPA2 WLAN Verbindung herstellen mit wpa_supplicant&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Standardmässig verschlüsselt man heutzutage sein WLAN mit WPA2 PSK. Mit <em>wpa_supplicant</em> kann man sich an diesem WLAN authentifizieren. Die Konfigurationsdatei dafür wird mit <em>wpa_passphrase</em> generiert.<br />
<span id="more-640"></span></p>
<h2>WLAN Netzwerk finden</h2>
<p>Zuerst wird das WLAN-Interface aktiviert (in meinem Fall heisst das Interface <em>wlan0</em>):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo ifconfig wlan0 up</div></div>
<p>Dann scannt man nach verfügbaren Netzwerken:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo iwlist wlan0 scan<br />
wlan0 &nbsp; &nbsp; Scan completed :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cell 01 - Address: 00:19:CB:03:E7:6A<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Channel:6<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Frequency:2.437 GHz (Channel 6)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Quality=60/70 &nbsp;Signal level=-50 dBm &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Encryption key:on<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ESSID:&quot;discordia&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 11 Mb/s; 12 Mb/s; 18 Mb/s<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mode:Master<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[...]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IE: IEEE 802.11i/WPA2 Version 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Group Cipher : CCMP<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Pairwise Ciphers (1) : CCMP<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Authentication Suites (1) : PSK<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[...]<br />
[...]</div></div>
<p>Wir sehen, das WLAN mit der ESSID <em>discordia</em> ist <em>802.11i/WPA2 Version 1 PSK</em> verschlüsselt.</p>
<h2>Konfiguration generieren</h2>
<p>Mit <em>wpa_passphrase</em> kann man die Konfigurationsdatei generieren. Falls man das Passwort nicht als zweiten Parameter angibt, liest <em>wpa_passphrase</em> von <em>STDIN</em> (Tastatureingabe). Am einfachsten schreibt man die Ausgabe direkt in eine Datei:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ wpa_passphrase discordia | sudo tee /etc/wpa_supplicant.conf.discordia</div></div>
<p>Nach der Eingabe vom Passwort kann man sich die Konfigurationsdatei anschauen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo cat /etc/wpa_supplicant.conf.discordia<br />
# reading passphrase from stdin<br />
network={<br />
&nbsp; ssid=&quot;discordia&quot;<br />
&nbsp; #psk=&quot;meinpasswort&quot;<br />
&nbsp; psk=129ffd04eefcce833590d91d88b00497584d3feb3d5fd05bc36218b301b978e0<br />
}</div></div>
<p>Die Kommentar-Zeilen kann man löschen. Diese werden von <em>wpa_supplicant</em> ignoriert. Vor allem das Passwort in Klartext sollte entfernt werden.</p>
<h2>Mit dem Netzwerk verbinden</h2>
<p>Um <em>wpa_supplicant</em> zu testen, startet man <em>wpa_supplicant</em> im Debugging-Modus:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf.discordia -d</div></div>
<p>Falls die Verbindung erfolgreich zustande kam, sieht mal folgende Meldung:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[...]<br />
EAPOL authentication completed successfully<br />
[...]</div></div>
<p>Mit <em>Ctrl-C</em> beendet man die Verbindung.</p>
<p>Funktioniert die Verbindung, kann man <em>wpa_supplicant</em> im Hintergrund als Daemon laufen lassen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf.discordia &nbsp;-B</div></div>
<p>Mit <em>ps</em> sieht man gut, dass der <em>wpa_supplicant</em> im Hintergrund läuft:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ps -ef | grep [w]pa_supplicant<br />
root &nbsp; &nbsp; 20405 &nbsp; &nbsp; 1 &nbsp;0 16:59 ? &nbsp; &nbsp; &nbsp; &nbsp;00:00:00 wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf.discordia -B</div></div>
<p>Das Tool <em>iwconfig</em> zeigt einem die Verbindung an:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ iwconfig wlan0<br />
wlan0 &nbsp; &nbsp; IEEE 802.11abgn &nbsp;ESSID:&quot;discordia&quot; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mode:Managed &nbsp;Frequency:2.437 GHz &nbsp;Access Point: 00:19:CB:03:E7:6A &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Bit Rate=54 Mb/s &nbsp; Tx-Power=15 dBm &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Retry &nbsp;long limit:7 &nbsp; RTS thr:off &nbsp; Fragment thr:off<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Power Management:off<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Link Quality=49/70 &nbsp;Signal level=-61 dBm &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rx invalid nwid:0 &nbsp;Rx invalid crypt:0 &nbsp;Rx invalid frag:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tx excessive retries:1 &nbsp;Invalid misc:30 &nbsp; Missed beacon:0</div></div>
<h2>Netzwerk konfigurieren</h2>
<p>Jetzt hat man sich aber erst gegenüger dem Accespoint authentifiziert. Eine Netzwerkkonfiguration vom Interface <em>wlan0</em> ist noch nicht vorhanden. Mit <em>dhclient</em> kann man sich von einem DHCP-Server die Konfiguration holen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo dhclient -v wlan0<br />
Internet Systems Consortium DHCP Client 4.2.3-P2<br />
Copyright 2004-2012 Internet Systems Consortium.<br />
All rights reserved.<br />
For info, please visit https://www.isc.org/software/dhcp/<br />
<br />
Listening on LPF/wlan0/58:94:6b:e9:fd:78<br />
Sending on &nbsp; LPF/wlan0/58:94:6b:e9:fd:78<br />
Sending on &nbsp; Socket/fallback<br />
DHCPREQUEST on wlan0 to 255.255.255.255 port 67<br />
DHCPACK from 10.0.0.20<br />
bound to 10.0.0.23 -- renewal in 34113 seconds.</div></div>
<p>Die Verbindung ins Internet steht:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ping -c 3 google.ch<br />
PING google.ch (173.194.35.24) 56(84) bytes of data.<br />
64 bytes from mil01s16-in-f24.1e100.net (173.194.35.24): icmp_req=1 ttl=56 time=29.3 ms<br />
64 bytes from mil01s16-in-f24.1e100.net (173.194.35.24): icmp_req=2 ttl=56 time=30.1 ms<br />
64 bytes from mil01s16-in-f24.1e100.net (173.194.35.24): icmp_req=3 ttl=56 time=28.2 ms<br />
<br />
--- google.ch ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2002ms<br />
rtt min/avg/max/mdev = 28.252/29.265/30.199/0.821 ms</div></div>
<p>Die Netzwerkkonfiguration kann man natürlich auch manuell ohne DHCP herstellen.</p>
<h2>Verbindung beenden</h2>
<p>Wenn man die Verbindung trennen will, kann man den <em>wpa_supplicant</em> beenden:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo pkill wpa_supplicant</div></div>
<h2>Links und weitere Informationen</h2>
<ul>
<li>Manpage: <em><a target="_blank" href="http://linux.die.net/man/8/ifconfig">ifconfig(8)</a></em></li>
<li>Manpage: <em><a target="_blank" href="http://linux.die.net/man/8/iwconfig">iwconfig(8)</a></em></li>
<li>Manpage: <em><a target="_blank" href="http://linux.die.net/man/8/iwlist">iwlist(8)</a></em></li>
<li>Manpage: <em><a target="_blank" href="http://linux.die.net/man/8/wpa_passphrase">wpa_passphrase:(8)</a></em></li>
<li>Manpage: <em><a target="_blank" href="http://linux.die.net/man/8/wpa_supplicant">wpa_supplicant(8)</a></em></li>
<li>Manpage: <em><a target="_blank" href="http://linux.die.net/man/8/dhclient">dhclient(8)</a></em></li>
</ul>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=640&amp;md5=c6e276b702d943bac312cbd3ecd8c2ba" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2012/01/eine-wpa2-wlan-verbindung-herstellen-mit-wpa_supplicant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=640&amp;md5=c6e276b702d943bac312cbd3ecd8c2ba" type="text/html" />
	</item>
		<item>
		<title>Arbeiten mit VI: In Register speichern und abrufen</title>
		<link>http://emanuelduss.ch/2011/11/arbeiten-mit-vi-in-register-speichern-und-abrufen/</link>
		<comments>http://emanuelduss.ch/2011/11/arbeiten-mit-vi-in-register-speichern-und-abrufen/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 21:13:09 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[konsole]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=618</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/11/arbeiten-mit-vi-in-register-speichern-und-abrufen/&amp;text=Arbeiten mit VI: In Register speichern und abrufen&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
In VI kann man eine oder mehrere Zeilen kopieren oder ausschneiden und diese in Register ablegen. Auf diese Register kann man dann später zugreifen und so den Text wieder einfügen. Syntax Die Befehle beginnen mit einem Anführungszeichen (&#8220;) gefolgt von einem Buchstaben. Dieser Buchstabe ist der Name vom Register. Danach kommt der eigentliche Befehl von [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/11/arbeiten-mit-vi-in-register-speichern-und-abrufen/&amp;text=Arbeiten mit VI: In Register speichern und abrufen&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>In VI kann man eine oder mehrere Zeilen kopieren oder ausschneiden und diese in Register ablegen. Auf diese Register kann man dann später zugreifen und so den Text wieder einfügen.<br />
<span id="more-618"></span></p>
<h2>Syntax</h2>
<p>Die Befehle beginnen mit einem Anführungszeichen (<em>&#8220;</em>) gefolgt von einem Buchstaben. Dieser Buchstabe ist der Name vom Register. Danach kommt der eigentliche Befehl von VI.</p>
<ul>
<li><em>&#8220;add</em>: Löscht die aktuelle Zeile und speichert sie in Buffer &#8220;a&#8221;</li>
<li><em>&#8220;bY</em>: Kopiert die aktuelle Zeile in den Buffer &#8220;b&#8221;</li>
<li><em>&#8220;ap</em>: Fügt die gelöschte Zeile aus Buffer &#8220;a&#8221; ein</li>
<li><em>&#8220;bp</em>: Fügt die kopierte Zeile aus Buffer &#8220;b&#8221; ein</li>
<li><em>:registers</em>: Alle Register auflisten</li>
</ul>
<h2>Beispiel</h2>
<p>Wir haben folgende drei Zeilen in einer Textdatei:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">* Zeile 1: Diese Zeile wird in Register 'a' kopiert.<br />
* Zeile 2: Diese Zeile wird in Register 'b' ausgeschnitten.<br />
* Zeile 3:</div></div>
<p>Folgende Aktionen werden durchgeführt:</p>
<ul>
<li><em>&#8220;aY</em>: Die erste Zeile wird in das Register <em>a</em> kopiert.</li>
<li><em>j</em>: Es wird auf die nächste Zeile gewechselt.</li>
<li><em>&#8220;bdd</em>: Die Zeile wird gelöscht und in Register <em>b</em> gespeichert.</li>
<li><em>&#8220;ap</em>: Der Inhalt vom Register <em>a</em> wird unterhalb eingefügt.</li>
<li><em>&#8220;bp</em>: Der Der Inhalt vom Register <em>b</em> wird unterhalb eingefügt.</li>
</ul>
<p>Danach sieht der Text so aus:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">* Zeile 1: Diese Zeile wird in Register 'a' kopiert.<br />
* Zeile 3:<br />
* Zeile 1: Diese Zeile wird in Register 'a' kopiert.<br />
* Zeile 2: Diese Zeile wird in Register 'b' ausgeschnitten.</div></div>
<p>Dieses Beispiel erklärt den Einsatz von Registern sehr gut.</p>
<h2>Weitere Informationen</h2>
<ul>
<li>VI-Hilfe: <em>:help registers</em></li>
</ul>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=618&amp;md5=5b8cb931c43d936aecd92d33fd4d78d7" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/11/arbeiten-mit-vi-in-register-speichern-und-abrufen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=618&amp;md5=5b8cb931c43d936aecd92d33fd4d78d7" type="text/html" />
	</item>
		<item>
		<title>Arbeiten mit VIM: Dateien in Tabs öffnen</title>
		<link>http://emanuelduss.ch/2011/10/arbeiten-mit-vim-dateien-in-tabs-offnen/</link>
		<comments>http://emanuelduss.ch/2011/10/arbeiten-mit-vim-dateien-in-tabs-offnen/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 19:31:57 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[konsole]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=593</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/10/arbeiten-mit-vim-dateien-in-tabs-offnen/&amp;text=Arbeiten mit VIM: Dateien in Tabs öffnen&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
VIM kann Dateien in Tabs darstellen. Dies ist sehr praktisch, wenn man mehrere Files gleichzeitig in einem Fenster bearbeiten und zwischen den einzelnen Dateien hin- und her wechseln will. Befehle Folgende Befehle sollte man in VIM kennen, um mit Tabs zu arbeiten: $ vim -p foo.tex bar.tex : Öffnet die zwei Files foo.tex und bar.tex [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/10/arbeiten-mit-vim-dateien-in-tabs-offnen/&amp;text=Arbeiten mit VIM: Dateien in Tabs öffnen&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>VIM kann Dateien in Tabs darstellen. Dies ist sehr praktisch, wenn man mehrere Files gleichzeitig in einem Fenster bearbeiten und zwischen den einzelnen Dateien hin- und her wechseln will.<br />
<span id="more-593"></span></p>
<h2>Befehle</h2>
<p>Folgende Befehle sollte man in VIM kennen, um mit Tabs zu arbeiten:</p>
<ul>
<li><em>$ vim -p foo.tex bar.tex</em> : Öffnet die zwei Files foo.tex und bar.tex mit VIM in Tabs</li>
<li><em>:tabe</em> : Neues File in neuem Tab öffnen</li>
<li><em>:tabe fnord.tex</em> : File fnord.tex in neuem Tab öffnen</li>
<li><em>gt</em> : Zum nächsten Tab wechseln</li>
<li><em>gT</em> : Zum vorhergehenden Tab wechseln</li>
<li><em>5gt</em> : Gehe zum 5. Tab</li>
</ul>
<h2>Beispiel</h2>
<p>Die Dateien <em>/etc/hosts</em>, <em>/etc/resolv.conf</em> und <em>/etc/rc.local</em> kann VIM in Tabs folgendermassen öffnen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vim -p /etc/hosts /etc/resolv.conf /etc/rc.local</div></div>
<p>Mit <em>:tabe</em> erstellt man eine neue leere Datei. Das sieht danach folgendermassen aus:</p>
<p><a href="http://emanuelduss.ch/wp-content/uploads/2011/10/vimtabs.png" rel="lightbox[593]"><img src="http://emanuelduss.ch/wp-content/uploads/2011/10/vimtabs-300x172.png" alt="" title="vimtabs" width="300" height="172" class="alignnone size-medium wp-image-594" /></a></p>
<h2>Weitere Informationen</h2>
<ul>
<li>Hilfe in VIM über Tabs: <em>:help tabs</em></li>
</ul>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=593&amp;md5=121443e91e3b5709a482d28fc7af8ba9" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/10/arbeiten-mit-vim-dateien-in-tabs-offnen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=593&amp;md5=121443e91e3b5709a482d28fc7af8ba9" type="text/html" />
	</item>
		<item>
		<title>Arbeiten mit VIM: Befehle aufzeichnen und abspielen (Recording)</title>
		<link>http://emanuelduss.ch/2011/10/arbeiten-mit-vim-befehle-aufzeichnen-und-abspielen-recording/</link>
		<comments>http://emanuelduss.ch/2011/10/arbeiten-mit-vim-befehle-aufzeichnen-und-abspielen-recording/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 17:01:41 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[VIM]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[konsole]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=559</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/10/arbeiten-mit-vim-befehle-aufzeichnen-und-abspielen-recording/&amp;text=Arbeiten mit VIM: Befehle aufzeichnen und abspielen (Recording)&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
In VIM kann man Tastatureingaben aufzeichnen und später wieder abspielen. So kann man Abläufe, welche man in einer Datei mehrmals durchführen muss, schnell und einfach automatisieren. Damit kann man sich Arbeiten sehr erleichtern! Syntax qx: Beginnt eine neue Aufnahme und speichert diese ins Register x q: Beendet die aktuelle Aufnahme @x: Führt die Befehle vom [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/10/arbeiten-mit-vim-befehle-aufzeichnen-und-abspielen-recording/&amp;text=Arbeiten mit VIM: Befehle aufzeichnen und abspielen (Recording)&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>In VIM kann man Tastatureingaben aufzeichnen und später wieder abspielen. So kann man Abläufe, welche man in einer Datei mehrmals durchführen muss, schnell und einfach automatisieren. Damit kann man sich Arbeiten sehr erleichtern!</p>
<p><span id="more-559"></span></p>
<h2>Syntax</h2>
<ul>
<li><em>qx</em>: Beginnt eine neue Aufnahme und speichert diese ins Register <em>x</em></li>
<li><em>q</em>: Beendet die aktuelle Aufnahme</li>
<li><em>@x</em>: Führt die Befehle vom Register <em>x</em> aus</li>
<li><em>@@</em>: Führt die Befehle vom zuletzt ausgeführten Register aus</li>
</ul>
<p>Dabei steht <em>x</em> für den Registernamen, welcher die Werte [0-9a-z] haben darf.</p>
<h2>Beispiel</h2>
<p>Wir haben folgende zwei Zeilen in VIM, welche wir unterstreichen möchten:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Das ist ein Titel<br />
<br />
Das ist auch ein Titel</div></div>
<p>Der erste Titel wird jetzt unterstrichen, wobei wir gleichzeitig die Befehle in das Register <em>a</em> speichern.</p>
<ul>
<li><em>qa</em>: Neue Aufnahme starten und in Register <em>a</em> speichern</li>
<li><em>Yp</em>: Zeile kopieren und darunter einfügen</li>
<li><em>Vr-</em>: Alle Zeichen der Zeile markieren und durch <em>-</em> ersetzen</li>
<li><em>o<ESC></em>: Neue Zeile unterhalb einfügen und in Normal-Mode wechseln</li>
<li><em>q</em>: Aufnahme beenden</li>
</ul>
<p>Das erzeugt folgendes Ergebnis:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Das ist ein Titel<br />
-----------------<br />
<br />
Das ist auch ein Titel</div></div>
<p>Jetzt kann man auf den zweiten Titel springen und mit <em>@a</em> die aufgenommenen Sequenzen abspielen. Das Ergebnis sieht danach so aus:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Das ist ein Titel<br />
-----------------<br />
<br />
Das ist auch ein Titel<br />
----------------------</div></div>
<p>Falls man noch weitere Titel unterstreichen will, wiederholt man die zuletzt abgespielte  Aufnahme mit <em>@@</em>.</p>
<h2>Weitere Informationen</h2>
<ul>
<li>VIM-Hilfe: <em>:help recording</em></li>
</ul>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=559&amp;md5=c8bd162dbd50361c97b472ff6364f803" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/10/arbeiten-mit-vim-befehle-aufzeichnen-und-abspielen-recording/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=559&amp;md5=c8bd162dbd50361c97b472ff6364f803" type="text/html" />
	</item>
		<item>
		<title>Ein DHCP-Server unter Debian einrichten</title>
		<link>http://emanuelduss.ch/2011/08/ein-dhcp-server-unter-debian-einrichten/</link>
		<comments>http://emanuelduss.ch/2011/08/ein-dhcp-server-unter-debian-einrichten/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 22:31:43 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Konfigurationsdateien]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Konfigurationsdatei]]></category>
		<category><![CDATA[netzwerk]]></category>
		<category><![CDATA[Protokoll]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=510</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/08/ein-dhcp-server-unter-debian-einrichten/&amp;text=Ein DHCP-Server unter Debian einrichten&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
DHCP steht für Dynamic Host Configuration Protocol. Mit einem DHCP-Server kann man Clients in einem Netzwerk automatisch eine IP-Konfiguration zuweisen. Somit muss man bei den Clients nicht manuell eine IP-Konfiguration vornehmen. Meistens wird über den DHCP-Server die IP-Adresse des Clients, die Subnetzmaske vom Netzwerk, der Default-Gateway und der zu verwendende DNS-Server verteilt. Installation Unter Debian [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/08/ein-dhcp-server-unter-debian-einrichten/&amp;text=Ein DHCP-Server unter Debian einrichten&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>DHCP steht für Dynamic Host Configuration Protocol. Mit einem DHCP-Server kann man Clients in einem Netzwerk automatisch eine IP-Konfiguration zuweisen. Somit muss man bei den Clients nicht manuell eine IP-Konfiguration vornehmen. Meistens wird über den DHCP-Server die IP-Adresse des Clients, die Subnetzmaske vom Netzwerk, der Default-Gateway und der zu verwendende DNS-Server verteilt.<br />
<span id="more-510"></span></p>
<h1>Installation</h1>
<p>Unter Debian heisst das Paket vom DHCP-Server <em>isc-dhcp-server</em> (früher <em>dhcp3-server</em>). Installiert wird es folgendermassen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> isc-dhcp-server</div></div>
<p>Nach der Installation ist der DHCP-Server noch nicht aktiv. Dieser muss zuerst konfiguriert werden.</p>
<h1>Konfiguration</h1>
<p>Das Konfigurationsfile vom DHCP-Server befindet sich nach der Installation im Verzeichnis <em>/etc/dhcp</em> und heisst <em>dhcpd.conf</em>.</p>
<p>Meine Konfiguration vom DHCP-Server ist relativ simpel und sieht folgendermassen aus:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">########################################################################<br />
#<br />
# /etc/dhcp/dhcpd.conf<br />
# Konfigurationsfile vom DHCP-Server (isc-dhcp-server)<br />
#<br />
# 2011-08-28; Emanuel Duss; Erste Version<br />
#<br />
########################################################################<br />
<br />
########################################################################<br />
# DHCP-Server<br />
########################################################################<br />
<br />
# Authoritative = Aktiv (Sendet DHCPNAK)<br />
authoritative;<br />
<br />
# Logging<br />
log-facility local7;<br />
<br />
# Lease-Time (86400 = 1 Tag)<br />
default-lease-time 86400;<br />
max-lease-time 86400;<br />
<br />
<br />
########################################################################<br />
# Globale Optionen<br />
########################################################################<br />
<br />
# Domain<br />
option domain-name &quot;duss.xy&quot;;<br />
<br />
# DNS-Server<br />
option domain-name-servers 10.0.0.20;<br />
<br />
# NTP-Server<br />
option ntp-servers 10.0.0.20;<br />
<br />
<br />
########################################################################<br />
# Subnetz<br />
########################################################################<br />
<br />
# Subnetz 10.0.0.0/24<br />
subnet 10.0.0.0 netmask 255.255.255.0 {<br />
&nbsp; # Range<br />
&nbsp; range 10.0.0.100 10.0.0.200;<br />
&nbsp; # Default-Gateway<br />
&nbsp; option routers 10.0.0.1;<br />
}<br />
<br />
<br />
########################################################################<br />
# Hosts<br />
########################################################################<br />
<br />
# Statische Adressen<br />
host eris {<br />
&nbsp; hardware ethernet 58:94:6B:E9:FD:78;<br />
&nbsp; fixed-address 10.0.0.23;<br />
}<br />
<br />
# EOF</div></div>
<p>Authoritative bedeutet, dass der DHCP-Server Clients im Netzwerk konfigurieren darf. Die Konfiguration ist ein Tag lang gültig. Dann muss der Client erneut eine Konfiguration anfordern. Meldungen schreibt der Daemon ins <em>syslog</em> (<em>/var/log/messages</em>).<br />
Die Clients bekommen die Domain <em>duss.xy</em>. Als DNS-Server wird <em>10.0.0.20</em> an die Clients verteilt.<br />
Aus dem Netz <em>10.0.0.0/24</em> können IP-Adressen aus dem Bereich <em>10.0.0.100</em> bis <em>10.0.0.200</em> verteilt werden. Um in andere Netze zu gelangen, wird der Default-Gateway <em>10.0.0.1</em> verteilt. Der Host <em>eris</em> mit der angegebenen MAC-Adresse bekommt immer dieselbe IP-Adresse <em>10.0.0.23</em> zugewiesen.</p>
<h1>Kontrolle auf dem Server</h1>
<p>Folgende Meldungen schreib der Syslog-Daemon ins File <em>/var/log/messages</em>:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo tail -f /var/log/messages | grep dhcpd<br />
Aug 30 23:49:31 debian dhcpd: DHCPDISCOVER from 00:15:af:dd:4f:ab via eth0<br />
Aug 30 23:49:32 debian dhcpd: DHCPOFFER on 10.0.0.108 to 00:15:af:dd:4f:ab (chaos) via eth0<br />
Aug 30 23:49:32 debian dhcpd: DHCPREQUEST for 10.0.0.108 (10.0.0.20) from 00:15:af:dd:4f:ab (chaos) via eth0<br />
Aug 30 23:49:32 debian dhcpd: DHCPACK on 10.0.0.108 to 00:15:af:dd:4f:ab (chaos) via eth0</div></div>
<p>Daran sieht man, dass die vier DHCP-Message-Types <em>DHCPDISCOVER</em>, <em>DHCPOFFER</em>, <em>DHCPREQUEST</em> und <em>DHCPACK</em> verschickt wurden.</p>
<p>Die selben vier Nachrichten sieht man auch mit dem Netzwerk-Sniffer <em>tcpdump</em>:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo tcpdump -n port 67 -i eth0<br />
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes<br />
23:49:31.921845 IP 0.0.0.0.68 &gt; 255.255.255.255.67: BOOTP/DHCP, Request from 00:15:af:dd:4f:ab, length 323<br />
23:49:32.000143 IP 10.0.0.20.67 &gt; 10.0.0.108.68: BOOTP/DHCP, Reply, length 300<br />
23:49:32.010123 IP 0.0.0.0.68 &gt; 255.255.255.255.67: BOOTP/DHCP, Request from 00:15:af:dd:4f:ab, length 335<br />
23:49:32.038398 IP 10.0.0.20.67 &gt; 10.0.0.108.68: BOOTP/DHCP, Reply, length 300</div></div>
<p>Was jedoch wirklich im DHCP-Protokoll steckt, zeigt das Tool <em>dhcpdump</em>. Dieses stellt die DHCP-Nachrichten schön leserlich dar.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo dhcpdump &nbsp;-i eth0<br />
&nbsp; TIME: 2011-08-30 23:49:31.922<br />
&nbsp; &nbsp; IP: 0.0.0.0 (0:15:af:dd:4f:ab) &gt; 255.255.255.255 (ff:ff:ff:ff:ff:ff)<br />
&nbsp; &nbsp; OP: 1 (BOOTPREQUEST)<br />
&nbsp;HTYPE: 1 (Ethernet)<br />
&nbsp; HLEN: 6<br />
&nbsp; HOPS: 0<br />
&nbsp; &nbsp;XID: 39ab2218<br />
&nbsp; SECS: 0<br />
&nbsp;FLAGS: 0<br />
CIADDR: 0.0.0.0<br />
YIADDR: 0.0.0.0<br />
SIADDR: 0.0.0.0<br />
GIADDR: 0.0.0.0<br />
CHADDR: 00:15:af:dd:4f:ab:00:00:00:00:00:00:00:00:00:00<br />
&nbsp;SNAME: .<br />
&nbsp;FNAME: .<br />
OPTION: &nbsp;53 ( &nbsp;1) DHCP message type &nbsp; &nbsp; &nbsp; &nbsp; 1 (DHCPDISCOVER)<br />
OPTION: &nbsp;57 ( &nbsp;2) Maximum DHCP message size 1500<br />
OPTION: &nbsp;60 ( 49) Vendor class identifier &nbsp; dhcpcd-5.2.12:Linux-2.6.39-ARCH:i686:GenuineIntel<br />
OPTION: &nbsp;12 ( &nbsp;5) Host name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chaos<br />
OPTION: &nbsp;55 ( 15) Parameter Request List &nbsp; &nbsp; &nbsp;1 (Subnet mask)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 121 (Classless Static Route)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;33 (Static route)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 (Routers)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 (DNS server)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;12 (Host name)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;15 (Domainname)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;26 (Interface MTU)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;28 (Broadcast address)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;42 (NTP servers)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;51 (IP address leasetime)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;54 (Server identifier)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;58 (T1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;59 (T2)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 119 (Domain Search)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
---------------------------------------------------------------------------<br />
<br />
&nbsp; TIME: 2011-08-30 23:49:32.000<br />
&nbsp; &nbsp; IP: 10.0.0.20 (0:1e:b:27:a2:94) &gt; 10.0.0.108 (0:15:af:dd:4f:ab)<br />
&nbsp; &nbsp; OP: 2 (BOOTPREPLY)<br />
&nbsp;HTYPE: 1 (Ethernet)<br />
&nbsp; HLEN: 6<br />
&nbsp; HOPS: 0<br />
&nbsp; &nbsp;XID: 39ab2218<br />
&nbsp; SECS: 0<br />
&nbsp;FLAGS: 0<br />
CIADDR: 0.0.0.0<br />
YIADDR: 10.0.0.108<br />
SIADDR: 0.0.0.0<br />
GIADDR: 0.0.0.0<br />
CHADDR: 00:15:af:dd:4f:ab:00:00:00:00:00:00:00:00:00:00<br />
&nbsp;SNAME: .<br />
&nbsp;FNAME: .<br />
OPTION: &nbsp;53 ( &nbsp;1) DHCP message type &nbsp; &nbsp; &nbsp; &nbsp; 2 (DHCPOFFER)<br />
OPTION: &nbsp;54 ( &nbsp;4) Server identifier &nbsp; &nbsp; &nbsp; &nbsp; 10.0.0.20<br />
OPTION: &nbsp;51 ( &nbsp;4) IP address leasetime &nbsp; &nbsp; &nbsp;86400 (24h)<br />
OPTION: &nbsp; 1 ( &nbsp;4) Subnet mask &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 255.255.255.0<br />
OPTION: &nbsp; 3 ( &nbsp;4) Routers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10.0.0.1<br />
OPTION: &nbsp; 6 ( &nbsp;4) DNS server &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10.0.0.20<br />
OPTION: &nbsp;15 ( &nbsp;7) Domainname &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;duss.xy<br />
OPTION: &nbsp;58 ( &nbsp;4) T1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;43200 (12h)<br />
OPTION: &nbsp;59 ( &nbsp;4) T2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;75600 (21h)<br />
---------------------------------------------------------------------------<br />
<br />
&nbsp; TIME: 2011-08-30 23:49:32.010<br />
&nbsp; &nbsp; IP: 0.0.0.0 (0:15:af:dd:4f:ab) &gt; 255.255.255.255 (ff:ff:ff:ff:ff:ff)<br />
&nbsp; &nbsp; OP: 1 (BOOTPREQUEST)<br />
&nbsp;HTYPE: 1 (Ethernet)<br />
&nbsp; HLEN: 6<br />
&nbsp; HOPS: 0<br />
&nbsp; &nbsp;XID: 39ab2218<br />
&nbsp; SECS: 0<br />
&nbsp;FLAGS: 0<br />
CIADDR: 0.0.0.0<br />
YIADDR: 0.0.0.0<br />
SIADDR: 0.0.0.0<br />
GIADDR: 0.0.0.0<br />
CHADDR: 00:15:af:dd:4f:ab:00:00:00:00:00:00:00:00:00:00<br />
&nbsp;SNAME: .<br />
&nbsp;FNAME: .<br />
OPTION: &nbsp;53 ( &nbsp;1) DHCP message type &nbsp; &nbsp; &nbsp; &nbsp; 3 (DHCPREQUEST)<br />
OPTION: &nbsp;50 ( &nbsp;4) Request IP address &nbsp; &nbsp; &nbsp; &nbsp;10.0.0.108<br />
OPTION: &nbsp;54 ( &nbsp;4) Server identifier &nbsp; &nbsp; &nbsp; &nbsp; 10.0.0.20<br />
OPTION: &nbsp;57 ( &nbsp;2) Maximum DHCP message size 1500<br />
OPTION: &nbsp;60 ( 49) Vendor class identifier &nbsp; dhcpcd-5.2.12:Linux-2.6.39-ARCH:i686:GenuineIntel<br />
OPTION: &nbsp;12 ( &nbsp;5) Host name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chaos<br />
OPTION: &nbsp;55 ( 15) Parameter Request List &nbsp; &nbsp; &nbsp;1 (Subnet mask)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 121 (Classless Static Route)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;33 (Static route)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 (Routers)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 (DNS server)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;12 (Host name)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;15 (Domainname)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;26 (Interface MTU)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;28 (Broadcast address)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;42 (NTP servers)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;51 (IP address leasetime)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;54 (Server identifier)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;58 (T1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;59 (T2)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 119 (Domain Search)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
---------------------------------------------------------------------------<br />
<br />
&nbsp; TIME: 2011-08-30 23:49:32.038<br />
&nbsp; &nbsp; IP: 10.0.0.20 (0:1e:b:27:a2:94) &gt; 10.0.0.108 (0:15:af:dd:4f:ab)<br />
&nbsp; &nbsp; OP: 2 (BOOTPREPLY)<br />
&nbsp;HTYPE: 1 (Ethernet)<br />
&nbsp; HLEN: 6<br />
&nbsp; HOPS: 0<br />
&nbsp; &nbsp;XID: 39ab2218<br />
&nbsp; SECS: 0<br />
&nbsp;FLAGS: 0<br />
CIADDR: 0.0.0.0<br />
YIADDR: 10.0.0.108<br />
SIADDR: 0.0.0.0<br />
GIADDR: 0.0.0.0<br />
CHADDR: 00:15:af:dd:4f:ab:00:00:00:00:00:00:00:00:00:00<br />
&nbsp;SNAME: .<br />
&nbsp;FNAME: .<br />
OPTION: &nbsp;53 ( &nbsp;1) DHCP message type &nbsp; &nbsp; &nbsp; &nbsp; 5 (DHCPACK)<br />
OPTION: &nbsp;54 ( &nbsp;4) Server identifier &nbsp; &nbsp; &nbsp; &nbsp; 10.0.0.20<br />
OPTION: &nbsp;51 ( &nbsp;4) IP address leasetime &nbsp; &nbsp; &nbsp;86400 (24h)<br />
OPTION: &nbsp; 1 ( &nbsp;4) Subnet mask &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 255.255.255.0<br />
OPTION: &nbsp; 3 ( &nbsp;4) Routers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10.0.0.1<br />
OPTION: &nbsp; 6 ( &nbsp;4) DNS server &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10.0.0.20<br />
OPTION: &nbsp;15 ( &nbsp;7) Domainname &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;duss.xy<br />
OPTION: &nbsp;58 ( &nbsp;4) T1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;43200 (12h)<br />
OPTION: &nbsp;59 ( &nbsp;4) T2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;75600 (21h)<br />
---------------------------------------------------------------------------</div></div>
<p>Die DHCP-Message-Types bedeuten folgendes:</p>
<ul>
<li><strong>DHCPDISCOVER</strong>: Der Client sendet per Broadcast eine Anfrage ins Netzwerk und fragt nach einer IP-Konfiguration. Dabei sagt er dem Server, wie er heisst und welche Parameter er annehmen kann. Unter der Parameter-Liste ist z. B. die Subnetzmaske, der DNS-Server, der Default-Gateway oder die Domain zu finden.</li>
<li><strong>DHCPOFFER</strong>: Der Server antwortet mit einem Konfigurations-Angebot.</li>
<li><strong>DHCPREQUEST</strong>: Falls das Angebot dem Client passt, fordert er die gewünschten Parameter an. </li>
<li><strong>DHCPACK</strong>: Falls alles funktioniert hat, bestätigt der DHCP-Server die Konfiguration.</li>
</ul>
<h1>Kontrolle auf dem Client</h1>
<p>Der Client hat die IP-Adresse <em>10.0.0.108</em> mit der Subnetzmaske <em>255.255.255.0</em> zugewiesen bekommen. Das sehen wir mit <em>ifconfig -a wlan0</em>:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ifconfig -a wlan0<br />
wlan0 &nbsp; &nbsp; Link encap:Ethernet &nbsp;HWaddr 00:15:AF:DD:4F:AB &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:10.0.0.108 &nbsp;Bcast:10.0.0.255 &nbsp;Mask:255.255.255.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet6 addr: fe80::215:afff:fedd:4fab/64 Scope:Link<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UP BROADCAST RUNNING MULTICAST &nbsp;MTU:1500 &nbsp;Metric:1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX packets:162 errors:0 dropped:0 overruns:0 frame:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX packets:121 errors:0 dropped:0 overruns:0 carrier:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; collisions:0 txqueuelen:1000 <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX bytes:16929 (16.5 Kb) &nbsp;TX bytes:19607 (19.1 Kb)</div></div>
<p>In der Routing-Tabelle sieht man den Default-Gateway <em>10.0.0.1</em>. Der Default-Gateway erkennt man immer an der Destination <em>0.0.0.0</em>.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ netstat -rn<br />
Kernel IP routing table<br />
Destination &nbsp; &nbsp; Gateway &nbsp; &nbsp; &nbsp; &nbsp; Genmask &nbsp; &nbsp; &nbsp; &nbsp; Flags &nbsp; MSS Window &nbsp;irtt Iface<br />
0.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; 10.0.0.1 &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; UG &nbsp; &nbsp; &nbsp; &nbsp;0 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 wlan0<br />
10.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; 255.255.255.0 &nbsp; U &nbsp; &nbsp; &nbsp; &nbsp; 0 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 wlan0</div></div>
<p>In der Datei <em>/etc/resolv.conf</em> sieht man die Domain (<em>duss.xy</em>) und der DNS-Server (<em>10.0.0.10</em>):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ cat /etc/resolv.conf<br />
# Generated by dhcpcd from wlan0<br />
# nameserver 8.8.8.8<br />
domain duss.xy<br />
nameserver 10.0.0.10<br />
# /etc/resolv.conf.tail can replace this line</div></div>
<p>Es lohnt sich auch die Konfiguration vom DHCP-Client anzuschauen! Wird der DHCP-Client <em>dhclient</em> verwendet, befindet sich die Konfiguration unter <em>/etc/dhcp/dhclient.conf</em> (Debian) bzw. unter <em>/etc/dhclient.conf</em> (Arch Linux).</p>
<h1>Links und weitere Informationen</h1>
<ul>
<li>Wikipedia: DHCP: <a href="http://de.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" target="_blank">http://de.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol</a></li>
<li>RFC2131: DHCP: <a href="http://www.rfc-editor.org/rfc/rfc2131.txt" target="_blank">http://www.rfc-editor.org/rfc/rfc2131.txt</a></li>
<li>Debian Manpage: <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=dhcpd.conf&#038;sektion=5&#038;apropos=0&#038;manpath=Debian+6.0+squeeze&#038;locale=" target="_blank">dhcpd.conf(5)</a></li>
<li>Debian Manpage: <a href="http://manpages.debian.net/cgi-bin/man.cgi?query=dhcpd&#038;sektion=8&#038;apropos=0&#038;manpath=Debian+6.0+squeeze&#038;locale=" target="_blank">dhcpd(8)</a></li>
</ul>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=510&amp;md5=d1069b23405437487c943e099ab56684" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/08/ein-dhcp-server-unter-debian-einrichten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=510&amp;md5=d1069b23405437487c943e099ab56684" type="text/html" />
	</item>
		<item>
		<title>IP-Adressen in DenyHosts wieder zulassen</title>
		<link>http://emanuelduss.ch/2011/07/ip-adressen-in-denyhosts-wieder-zulassen/</link>
		<comments>http://emanuelduss.ch/2011/07/ip-adressen-in-denyhosts-wieder-zulassen/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 21:07:54 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Skripts]]></category>
		<category><![CDATA[denyhosts]]></category>
		<category><![CDATA[netzwerk]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=472</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/07/ip-adressen-in-denyhosts-wieder-zulassen/&amp;text=IP-Adressen in DenyHosts wieder zulassen&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
DenyHosts kann dazu verwendet werden, BruteForce-Angriffe abzuwehren. DenyHosts durchsucht Logfiles auf fehlerhafte Logins und sperrt diese nach einer gewissen Anzahl. Blöd ist nur, wenn man sich selber raussperrt. Mit meinem kleinen Skript kann man eine IP-Adresse in DenyHosts wieder entsperren. Manuell Zuerst stoppt man den DenyHosts-Daemon: $ sudo /etc/init.d/denyhosts stop Stopping DenyHosts: denyhosts. Die IP-Adresse [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/07/ip-adressen-in-denyhosts-wieder-zulassen/&amp;text=IP-Adressen in DenyHosts wieder zulassen&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>DenyHosts kann dazu verwendet werden, BruteForce-Angriffe abzuwehren. DenyHosts durchsucht Logfiles auf fehlerhafte Logins und sperrt diese nach einer gewissen Anzahl. Blöd ist nur, wenn man sich selber raussperrt. Mit meinem kleinen Skript kann man eine IP-Adresse in DenyHosts wieder entsperren.<br />
<span id="more-472"></span></p>
<h2>Manuell</h2>
<p>Zuerst stoppt man den DenyHosts-Daemon:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>denyhosts stop<br />
Stopping DenyHosts: denyhosts.</div></div>
<p>Die IP-Adresse muss danach aus dem File <em>/etc/hosts.deny</em> gelöscht werden.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts.deny</div></div>
<p>Dies genügt jedoch noch nicht ganz. Die IP-Adresse ist immer noch nicht erlaubt. DenyHosts führt seperate Listen in einem eigenen Verzeichnis. Das Verzeichnis findet man mit folgendem Befehl heraus:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">grep</span> ^WORK_DIR <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>denyhosts.conf<br />
WORK_DIR = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>denyhosts</div></div>
<p>Standardmässig wird das Verzeichnis /var/lib/denyhosts verwendet. In diesem Verzeichnis muss man die IP-Adresse ebenfalls aus den Files <em>hosts-restricted</em>, <em>hosts-root</em>, <em>hosts-valid</em> und <em>users-hosts</em> löschen. Das kann man z.B. mit dem VI-Editor machen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-l</span> 23.42.05.13 <span style="color: #000000; font-weight: bold;">*`</span></div></div>
<p>Zum Schluss startet man den Daemon wieder:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>denyhosts start<br />
Starting DenyHosts: denyhosts.</div></div>
<h2>Skript</h2>
<p>Das geht natürlich viel einfacher mit einem Skript! Folgendes Skript löscht eine IP-Adresse aus den nötigen Files:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># rmdenyhosts</span><br />
<span style="color: #666666; font-style: italic;"># Entfernt DenyHosts-Eintraege</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Copyright 2011 Emanuel Duss</span><br />
<span style="color: #666666; font-style: italic;"># Licensed under GNU General Public License</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># 2011-07-03; Emanuel Duss; Erste Version</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;"># Variabeln</span><br />
<span style="color: #007800;">DENYHOSTS</span>=<span style="color: #ff0000;">&quot;/etc/init.d/denyhosts&quot;</span><br />
<span style="color: #007800;">DENYDIR</span>=<span style="color: #ff0000;">&quot;/var/lib/denyhosts&quot;</span><br />
<span style="color: #007800;">GOODHOST</span>=<span style="color: #ff0000;">&quot;$1&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;"># Funktionen</span><br />
usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; EOF<br />
Usage:<br />
&nbsp; $0 IP-Adresse<br />
EOF</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;"># Main</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Variable gesetzt?</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$GOODHOST</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Keine IP-Adresse angegeben!&quot;</span><br />
&nbsp; usage<br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #666666; font-style: italic;"># DenyHosts stoppen</span><br />
<span style="color: #007800;">$DENYHOSTS</span> stop<br />
<br />
<span style="color: #666666; font-style: italic;"># Eintraege entfernen</span><br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$DENYDIR</span><span style="color: #000000; font-weight: bold;">/</span>hosts \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #007800;">$DENYDIR</span><span style="color: #000000; font-weight: bold;">/</span>hosts-restricted \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #007800;">$DENYDIR</span><span style="color: #000000; font-weight: bold;">/</span>hosts-root \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #007800;">$DENYDIR</span><span style="color: #000000; font-weight: bold;">/</span>hosts-valid \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #007800;">$DENYDIR</span><span style="color: #000000; font-weight: bold;">/</span>users-hosts \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts.deny<br />
<span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'/'</span><span style="color: #007800;">$GOODHOST</span><span style="color: #ff0000;">'/d'</span> <span style="color: #007800;">$i</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$i</span>.tmp<br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$i</span>.tmp <span style="color: #007800;">$i</span><br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
<span style="color: #666666; font-style: italic;"># DenyHosts starten</span><br />
<span style="color: #007800;">$DENYHOSTS</span> start<br />
<br />
<span style="color: #666666; font-style: italic;"># EOF</span></div></div>
<h2>Download</h2>
<p><a href='http://emanuelduss.ch/wp-content/uploads/2011/07/rmdenyhosts.tar'>rmdenyhosts.tar</a> (MD5: b84463ec481766701ef48d0aa5d3ce59)</p>
<h2>Weitere Informationen / Links</h2>
<ul>
<li>DenyHosts auf SourceForge: <a href="http://denyhosts.sourceforge.net/">http://denyhosts.sourceforge.net/</a></li>
</ul>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=472&amp;md5=db81911873a3c5a9f1a25b20ab5d0bae" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/07/ip-adressen-in-denyhosts-wieder-zulassen/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=472&amp;md5=db81911873a3c5a9f1a25b20ab5d0bae" type="text/html" />
	</item>
		<item>
		<title>Samba/CIFS Filesysteme vor dem Herunterfahren automatisch umounten</title>
		<link>http://emanuelduss.ch/2011/04/sambacifs-filesysteme-vor-dem-herunterfahren-umounten/</link>
		<comments>http://emanuelduss.ch/2011/04/sambacifs-filesysteme-vor-dem-herunterfahren-umounten/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 12:34:14 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Konfigurationsdateien]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[cifs]]></category>
		<category><![CDATA[Konfigurationsdatei]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=449</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/04/sambacifs-filesysteme-vor-dem-herunterfahren-umounten/&amp;text=Samba/CIFS Filesysteme vor dem Herunterfahren automatisch umounten&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Oft dauert das Herunterfahren von Linux-Systemen sehr lange, weil noch Samba bzw. CIFS-Filesysteme gemountet sind. Diese Filesysteme können jeweils nicht sauber ausgehängt werden, was lange dauert. Deshalb hängt man diese am besten vor dem Herunterfahren der Maschine aus. Manuell Die Filesysteme können manuell ausgehängt werden: $ sudo umount /media/nasdata Automatisch Dieser Teil bezieht sich auf [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/04/sambacifs-filesysteme-vor-dem-herunterfahren-umounten/&amp;text=Samba/CIFS Filesysteme vor dem Herunterfahren automatisch umounten&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Oft dauert das Herunterfahren von Linux-Systemen sehr lange, weil noch Samba bzw. CIFS-Filesysteme gemountet sind. Diese Filesysteme können jeweils nicht sauber ausgehängt werden, was lange dauert. Deshalb hängt man diese am besten vor dem Herunterfahren der Maschine aus.<br />
<span id="more-449"></span></p>
<p><strong>Manuell</strong><br />
Die Filesysteme können manuell ausgehängt werden:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>nasdata</div></div>
<p><strong>Automatisch</strong><br />
Dieser Teil bezieht sich auf Arch Linux.</p>
<p>Einfacher geht es jedoch mit dem <em>rc.local.shutdown</em> Skript. Dieses Skript wird bei jedem Herunterfahren automatisch ausgeführt.</p>
<p>Man bearbeitet die Datei <em>rc.local.shutdown</em>, welche im <em>/etc</em> Verzeichnis liegt.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.local.shutdown</div></div>
<p>Folgende Zeilen werden in die Datei <em>/etc/rc.local.shutdown</em> geschrieben:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># umount all cifs filesystems</span><br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/cifs/{ print $2 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mtab<span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #007800;">$i</span><br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<p>Jetzt werden diese Filesysteme vor dem Herunterfahren automatisch ausgehängt und das Herunterfahren geht viel schneller.</p>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=449&amp;md5=467851a9ddec096cecfce170bade33aa" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/04/sambacifs-filesysteme-vor-dem-herunterfahren-umounten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=449&amp;md5=467851a9ddec096cecfce170bade33aa" type="text/html" />
	</item>
		<item>
		<title>Meine Konfigurationsdatei für VIM (.vimrc)</title>
		<link>http://emanuelduss.ch/2011/04/meine-konfigurationsdatei-fur-vim-vimrc/</link>
		<comments>http://emanuelduss.ch/2011/04/meine-konfigurationsdatei-fur-vim-vimrc/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 18:03:07 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Konfigurationsdateien]]></category>
		<category><![CDATA[VIM]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[Konfigurationsdatei]]></category>
		<category><![CDATA[konsole]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=89</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/04/meine-konfigurationsdatei-fur-vim-vimrc/&amp;text=Meine Konfigurationsdatei für VIM (.vimrc)&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Der Texteditor VIM kann mit der Datei ~/.vimrc konfiguriert werden. Alle Befehle in dieser Datei werden beim Start ausgeführt. Dies ist meine Konfigurationsdatei für VIM: &#34;####################################################################### &#34; &#34; ~/.vimrc &#34; vim Konfigurationsdatei &#34; &#34; Copyright 2011 Emanuel Duss &#34; Licensed under GNU General Public License &#34; &#34; 2010-06-19; Emanuel Duss; Erste Version &#34; 2011-02-08; Emanuel [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/04/meine-konfigurationsdatei-fur-vim-vimrc/&amp;text=Meine Konfigurationsdatei für VIM (.vimrc)&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Der Texteditor VIM kann mit der Datei <em>~/.vimrc</em> konfiguriert werden. Alle Befehle in dieser Datei werden beim Start ausgeführt.<br />
<span id="more-89"></span></p>
<p>Dies ist meine Konfigurationsdatei für VIM:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&quot;#######################################################################<br />
&quot;<br />
&quot; ~/.vimrc<br />
&quot; vim Konfigurationsdatei<br />
&quot;<br />
&quot; Copyright 2011 Emanuel Duss<br />
&quot; Licensed under GNU General Public License<br />
&quot;<br />
&quot; 2010-06-19; Emanuel Duss; Erste Version<br />
&quot; 2011-02-08; Emanuel Duss; Neu: set list; set listchars<br />
&quot; 2011-02-14; Emanuel Duss; Neu: endocing=utf8<br />
&quot;<br />
&quot;#######################################################################<br />
<br />
&quot;#######################################################################<br />
&quot; Einstellungen<br />
set nocompatible &nbsp; &quot; VIM-Zusätze aktivieren<br />
set encoding=utf8 &nbsp;&quot; UTF8 als Zeichensatz<br />
set mouse=a &nbsp; &nbsp; &nbsp; &nbsp;&quot; Mausunterstüzung aktivieren<br />
set number &nbsp; &nbsp; &nbsp; &nbsp; &quot; Zeilennummern angeben<br />
set incsearch &nbsp; &nbsp; &nbsp;&quot; Zeigt Suchergebnisse während dem Suchen an<br />
set hlsearch &nbsp; &nbsp; &nbsp; &quot; Suchresultate farbig hervorheben<br />
set ignorecase &nbsp; &nbsp; &quot; Ignoriert Gross/Kleinschreibung beim Suchen<br />
set smartcase &nbsp; &nbsp; &nbsp;&quot; Nur Gross/Kleinschreibung beachten, wenn Grossbuchstabe vorhanden<br />
set autoread &nbsp; &nbsp; &nbsp; &quot; Liest die Datei neu, wenn ausserhalb von VIM geändert.<br />
set backup &nbsp; &nbsp; &nbsp; &nbsp; &quot; Erstellt eine Backup-Datei<br />
set tabstop=2 &nbsp; &nbsp; &nbsp;&quot; Tabulator entspricht 2 Leerzeichen<br />
set softtabstop=2 &nbsp;&quot; Weicher Tabulator<br />
set shiftwidth=2 &nbsp; &quot; Einrücktiefe<br />
set autoindent &nbsp; &nbsp; &quot; Automatisch einrücken<br />
set expandtab &nbsp; &nbsp; &nbsp;&quot; Tabulatoren in Spaces umwandeln<br />
set wrap &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot; Zeilenumbruch aktivieren<br />
set list &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot; listchars anzeigen<br />
set listchars=tab:»·,trail:· &quot; Tabs und Leerzeichen am Zeilenende anzeigen<br />
<br />
colorscheme default &nbsp;&quot; Farbschema<br />
&quot; colorscheme desert &nbsp;&quot; Farbschema<br />
<br />
syntax on &nbsp; &nbsp; &nbsp; &nbsp; &quot; Code farbig darstellen<br />
<br />
&quot;#######################################################################<br />
&quot; Makros<br />
map &lt;F12&gt; :w!&lt;CR&gt;:!aspell --lang=de check %&lt;CR&gt;:e! %&lt;CR&gt;<br />
map &lt;F5&gt; :w! &lt;CR&gt;:! pdflatex % &lt;CR&gt;<br />
<br />
map &lt;leader&gt;hex :%!xxd&lt;CR&gt; &nbsp; &nbsp; &nbsp; &nbsp;&quot; Hexeditor mit \hex starten<br />
map &lt;leader&gt;nhex :%!xxd -r&lt;CR&gt; &nbsp; &nbsp;&quot; Hexeditor mit \nhex beenden<br />
<br />
map &lt;F2&gt; i########################################################################&lt;CR&gt;&lt;ESC&gt;<br />
map &lt;F3&gt; :r!date +\%Y-\%m-\%d&lt;CR&gt;<br />
map &lt;F4&gt; :r!date +\%Y-\%m-\%d_\%H-\%M-\%S&lt;CR&gt;<br />
<br />
&quot; EOF</div></div>
<p>Anregungen, Kritik und Fragen können gerne in den Kommentaren hinterlassen werden.</p>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=89&amp;md5=ba281bbee1819a4e2b03376329fcf079" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/04/meine-konfigurationsdatei-fur-vim-vimrc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=89&amp;md5=ba281bbee1819a4e2b03376329fcf079" type="text/html" />
	</item>
		<item>
		<title>Dateisystem verschlüsseln mit LUKS</title>
		<link>http://emanuelduss.ch/2011/03/dateisyste-verschlusseln-mit-luks/</link>
		<comments>http://emanuelduss.ch/2011/03/dateisyste-verschlusseln-mit-luks/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 20:31:12 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=402</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/03/dateisyste-verschlusseln-mit-luks/&amp;text=Dateisystem verschlüsseln mit LUKS&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Mit dm-crpyt kann man unter Linux Festplatten bzw. Dateisysteme verschlüsseln. LUKS (Linux Unified Key Setup) erweitert dm-crypt um einige Funktionen. LUKS ermöglicht zum Beispiel das Verwalten von mehreren Schlüsseln, sowie das automatische erkennen und einbinden von verschlüsselten Geräten ins Dateisystem. LUKS wird mit dem Tool cryptsetup eingerichtet. Logical Volume verschlüsseln 10 GB grosses Logical Volume [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/03/dateisyste-verschlusseln-mit-luks/&amp;text=Dateisystem verschlüsseln mit LUKS&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Mit <em>dm-crpyt</em> kann man unter Linux Festplatten  bzw. Dateisysteme verschlüsseln. <em>LUKS</em> (Linux Unified Key Setup) erweitert dm-crypt um einige Funktionen. LUKS ermöglicht zum Beispiel das Verwalten von mehreren Schlüsseln, sowie das automatische erkennen und einbinden von verschlüsselten Geräten ins Dateisystem. LUKS wird mit dem Tool <em>cryptsetup</em> eingerichtet.</p>
<p><span id="more-402"></span></p>
<p><strong>Logical Volume verschlüsseln</strong><br />
10 GB grosses Logical Volume mit dem Namen <em>seucre</em> in der Volume Group <em>rootvg</em> anlegen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lvcreate <span style="color: #660033;">-n</span> secure <span style="color: #660033;">-L</span> 100G rootvg</div></div>
<p>Logical Volume verschlüsseln (sicheres Passwort auswählen):</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cryptsetup <span style="color: #660033;">-c</span> aes-xts-plain <span style="color: #660033;">-y</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">512</span> luksFormat <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>rootvg-secure</div></div>
<p>Verschlüsseltes Logical Volume öffnen (Passwort eingeben):</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cryptsetup luksOpen <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>rootvg-secure secure</div></div>
<p>Dateisystem anlegen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkfs.ext4 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p>Mountpoint erstellen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>emanuel<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p>Filesystem mounten:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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>mapper<span style="color: #000000; font-weight: bold;">/</span>secure <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>emanuel<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p>Jetzt werden alle Dateien für den Benutzer transparent verschlüsselt.</p>
<p>Dateisystem aushängen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>emanuel<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p>Verschlüsseltes Logical Volume schliessen (erst dann ist das Logical Volume wieder geschützt!!!):</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cryptsetup luksClose <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p><strong>Verschlüsseltes Logical Volume verwenden</strong><br />
Folgende Schritte sind immer nötig um das Logical Volume verwenden zu können:</p>
<p>Filesystem einbinden:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cryptsetup luksOpen <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>rootvg-secure secure<br />
<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>mapper<span style="color: #000000; font-weight: bold;">/</span>secure <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>emanuel<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p>Filesystem aushängen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>emanuel<span style="color: #000000; font-weight: bold;">/</span>secure<br />
cryptsetup luksClose <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p><strong>Automatisch mounten</strong><br />
Das verschlüsselte Dateisystem kann beim Booten automatisch gemountet werden. Man wird während dem Bootvorgang nach dem Passwort gefragt.</p>
<p>Label anlegen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tune2fs <span style="color: #660033;">-L</span> secure <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>secure</div></div>
<p>Datei <em>/etc/crypttab</em> bearbeiten:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>crypttab</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">secure &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/dev/mapper/rootvg-secure &nbsp; &nbsp; &nbsp;ASK</div></div>
<p>Datei <em>/etc/fstab</em> bearbeiten:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/mapper/secure /home/emanueL/secure ext4 defaults 0 1</div></div>
<p><strong>Logical Volume über ein Skript mounten</strong><br />
Ich mounte mein verschlüsseltes Dateisystem lieber bei Gebrauch mit einem kleinen Skript:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># securelv</span><br />
<span style="color: #666666; font-style: italic;"># Mountet ein LUKS verschuesseltes Device</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Copyright 2011 Emanuel Duss</span><br />
<span style="color: #666666; font-style: italic;"># Licensed under GNU General Public License</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># 2011-03-14; Emanuel Duss; Erste Version</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;"># Variabeln</span><br />
<span style="color: #007800;">MOUNTPATH</span>=<span style="color: #ff0000;">&quot;/home/emanuel/secure&quot;</span><br />
<span style="color: #007800;">LV</span>=<span style="color: #ff0000;">&quot;/dev/mapper/rootvg-secure&quot;</span><br />
<span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;secure&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;"># Funktionen</span><br />
usage <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage:<br />
&nbsp; $0 { mount | umount }&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################################</span><br />
<span style="color: #666666; font-style: italic;"># Main</span><br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">in</span><br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">mount</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; cryptsetup luksOpen <span style="color: #007800;">$LV</span> <span style="color: #007800;">$NAME</span><br />
&nbsp; &nbsp; <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>mapper<span style="color: #000000; font-weight: bold;">/</span>secure <span style="color: #007800;">$MOUNTPATH</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">umount</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #007800;">$MOUNTPATH</span><br />
&nbsp; &nbsp; cryptsetup luksClose <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NAME</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; usage<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
<span style="color: #000000; font-weight: bold;">esac</span><br />
<br />
<span style="color: #666666; font-style: italic;">#EOF</span></div></div>
<p><strong>Weitere Aufgaben</strong><br />
Status vom verschlüsseltem Logical Volumes abfragen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cryptsetup status secure</div></div>
<p>Weiteres Passwort hinzufügen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cryptsetup luksAddKey /dev/mapper/rootvg-secure</div></div>
<p>Passwort entfernen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cryptsetup luksDelKey /dev/mapper/rootvg-secure</div></div>
<p><strong>Links für weitere Informationen</strong></p>
<ul>
<li><a href="http://de.wikipedia.org/wiki/Dm-crypt" target="_blank">http://de.wikipedia.org/wiki/Dm-crypt</a></li>
<li><a href="http://code.google.com/p/cryptsetup/" target="_blank">http://code.google.com/p/cryptsetup/>http://code.google.com/p/cryptsetup/</a></li>
<li><a href="http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions" target="_blank">http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions</a></li>
<li><a href="http://www.inetcom.ch/verschluesselung-luks-und-lvm" target="_blank">http://www.inetcom.ch/verschluesselung-luks-und-lvm</a></li>
<li><a href="http://stesind.blogspot.com/2009/09/externe-festplatte-mit-luks.html" target="_blank">http://stesind.blogspot.com/2009/09/externe-festplatte-mit-luks.html</a></li>
<li><a href="https://systemausfall.org/wikis/howto/CryptoPartitionHowTo" target="_blank">https://systemausfall.org/wikis/howto/CryptoPartitionHowTo</a></li>
<li><a href="https://wiki.archlinux.de/title/Festplatte_verschl%C3%BCsseln" target="_blank">https://wiki.archlinux.de/title/Festplatte_verschl%C3%BCsseln</a></li>
<li><a href="https://wiki.archlinux.org/index.php/System_Encryption_with_LUKS_for_dm-crypt" target="_blank">https://wiki.archlinux.org/index.php/System_Encryption_with_LUKS_for_dm-crypt</a></li>
</ul>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=402&amp;md5=1dbcbe36c1fc61b32c47ff488d495344" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/03/dateisyste-verschlusseln-mit-luks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=402&amp;md5=1dbcbe36c1fc61b32c47ff488d495344" type="text/html" />
	</item>
		<item>
		<title>Arch Linux Grundinstallation mit LVM</title>
		<link>http://emanuelduss.ch/2011/03/arch-linux-grundinstallation-mit-lvm/</link>
		<comments>http://emanuelduss.ch/2011/03/arch-linux-grundinstallation-mit-lvm/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 18:45:14 +0000</pubDate>
		<dc:creator>Emanuel Duss</dc:creator>
				<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">http://emanuelduss.ch/?p=356</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/03/arch-linux-grundinstallation-mit-lvm/&amp;text=Arch Linux Grundinstallation mit LVM&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Das verändern der Grösse von einem Filesystem während der Laufzeit ist nur einer der Vorteile vom Logical Volume Manager (LVM). Deshalb habe ich bei meiner Arch Linux Installation auf LVM gesetzt. Der Logical Volume Manager Mit dem Logical Volume Manager kann man Festplatten verwalten. Folgende Grafik (welche ich auch auf Wikipedia veröffentlicht habe), zeigt den [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://emanuelduss.ch/2011/03/arch-linux-grundinstallation-mit-lvm/&amp;text=Arch Linux Grundinstallation mit LVM&amp;via=mindfuckup&amp;related=DolcePixel"><img align="right" src="http://emanuelduss.ch/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Das verändern der Grösse von einem Filesystem während der Laufzeit ist nur einer der Vorteile vom Logical Volume Manager (LVM). Deshalb habe ich bei meiner Arch Linux Installation auf LVM gesetzt.</p>
<p><span id="more-356"></span><br />
<strong>Der Logical Volume Manager</strong><br />
Mit dem Logical Volume Manager kann man Festplatten verwalten. Folgende Grafik (welche ich auch auf Wikipedia veröffentlicht habe), zeigt den Zusammenhang zwischen Physical Partition (PP), Physical Volumes (PV), Logical Volumes (LV) und Volume Groups (VG) sehr gut:</p>
<p><a href="http://emanuelduss.ch/wp-content/uploads/2011/03/lvm.png" rel="lightbox[356]"><img src="http://emanuelduss.ch/wp-content/uploads/2011/03/lvm.png" alt="" title="lvm" width="620" height="600" class="alignnone size-full wp-image-383" /></a></p>
<p>Kurz gesagt: Ein Logical Volume gehört immer zu einer Volume Group und besteht aus mehreren Physical Partitions, welche auf verschiedenen Physical Volumes liegen können. Das Filesystem wird auf dem Logical Volume angelegt und kann dann gemountet werden.</p>
<p><strong>Arch Linux herunterladen und starten</strong><br />
Das ISO-Image von Arch linux wird heruntergeladen und auf den USB-Stick kopiert:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget ftp://archlinux.puzzle.ch/iso/2010.05/archlinux-2010.05-netinstall-dual.iso<br />
dd if=archlinux-2010.05-netinstall-dual.iso of=/deb/sdX</div></div>
<p>Dann bootet man ab dem USB-Stick und meldet sich als <em>root</em> an. Der Benutzer root hat kein Passwort.</p>
<p>Als nächstes wird das Tastaturlayout geändert:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># km</div></div>
<p>- Keymap: i386/quertz/de_CH-latin1.map.gz<br />
- Console Font: default8x16.psfu.gz</code></p>
<p>Ich arbeite besser, wenn ich den VI-Mode in der Shell aktiviert habe:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># set -o vi</div></div>
<p><strong>Festplatten vorbereiten</strong><br />
Mit cfdisk erstellt man zwei Partitionen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># cfdisk</div></div>
<p>Diese sehen folgendermassen aus:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sda1 &nbsp;Boot &nbsp;Primary &nbsp;Linux &nbsp; &nbsp; &nbsp;100MB<br />
sda2 &nbsp; &nbsp; &nbsp; &nbsp;Primary &nbsp;Linux LVM &nbsp;400GB</div></div>
<p>Physical Volume (PV) erstellen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># pvcreate /dev/sda2</div></div>
<p>Volume Group (VG) mit dem vorher angelegten Physical Volume erstellen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># vgcreate rootvg /dev/sda2</div></div>
<p>Logical Volumes erstellen:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># lvcreate -n swap -L 4G -C y rootvg <br />
# lvcreate -n root -L 25G rootvg<br />
# lvcreate -n home -L 320G rootvg</div></div>
<p>Das LVM-Layout kann mit den Befehlen <em>pvs</em>, <em>vgs</em> und <em>lvs</em> überprüft werden. Die Befehle <em>pvdisplay</em>, <em>vgdisplay</em> und <em>lvdisplay</em> geben noch mehr Informationen aus.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># pvs<br />
&nbsp; PV &nbsp; &nbsp; &nbsp; &nbsp; VG &nbsp; &nbsp; Fmt &nbsp;Attr PSize &nbsp; PFree <br />
&nbsp; /dev/sda2 &nbsp;rootvg lvm2 a- &nbsp; 465.66g 16.66g</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># vgs<br />
&nbsp; VG &nbsp; &nbsp; #PV #LV #SN Attr &nbsp; VSize &nbsp; VFree <br />
&nbsp; rootvg &nbsp; 1 &nbsp; 4 &nbsp; 0 wz--n- 465.66g 16.66g</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># lvs<br />
&nbsp; LV &nbsp; &nbsp; VG &nbsp; &nbsp; Attr &nbsp; LSize &nbsp; Origin Snap% &nbsp;Move Log Copy% &nbsp;Convert<br />
&nbsp; home &nbsp; rootvg -wi-ao 320.00g &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; root &nbsp; rootvg -wi-ao &nbsp;25.00g &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; swap &nbsp; rootvg -wc-ao &nbsp; 4.00g</div></div>
<p><strong>Arch Linux installieren</strong><br />
Setup starten:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># /arch/setup</div></div>
<p><em>1) Select Source</em><br />
  - DHCP<br />
  - Mirror aus der Nähe auswählen</p>
<p><em>2) Set clock</em><br />
  - Timezone: Europa / Zürich<br />
  - Zeit einstellen: UTC<br />
  - Abgleich mit NTP</p>
<p><em>3) Prepare Hard Drive(s)</em><br />
  - Manually Configure block devices, filesystems and mountpoints → dev</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/sda1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext2 &nbsp; &nbsp; &nbsp; /boot &nbsp; &nbsp;boot<br />
/dev/mapper/rootvg-home &nbsp; &nbsp; ext4 &nbsp; &nbsp; &nbsp; /home &nbsp; &nbsp;home<br />
/dev/mapper/rootvg-root &nbsp; &nbsp; ext4 &nbsp; &nbsp; &nbsp; / &nbsp; &nbsp; &nbsp; &nbsp;root<br />
/dev/mapper/rootvg-swap &nbsp; &nbsp; swap</div></div>
<p><em>4) Select Packages</em><br />
  - [*] base</p>
<p><em>5) Install Packages</em></p>
<p><em>6) Configure System</em><br />
 /etc/rc.conf</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">LOCALE=&quot;de_CH.UTF-8&quot;<br />
KEYMAP=&quot;de_CH-latin1&quot;<br />
USELVM=&quot;YES&quot;<br />
HOSTNAME=&quot;eris&quot;<br />
MODULES=(... !pcspkr ...)</div></div>
<p>/etc/fstab</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/mapper/rootvg-home /home ext4 defaults 0 1<br />
/dev/mapper/rootvg-root / ext4 defaults 0 1<br />
/dev/mapper/rootvg-swap swap swap defaults 0 0<br />
/dev/sda1 /boot ext2 defaults 0 1</div></div>
<p>/etc/mkinitcpio.conf</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">HOOKS=&quot;base udev usb usbinput keymap autodetect pata scsi sata lvm2 filesystems&quot;</div></div>
<p>/etc/hosts</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">127.0.0.1 &nbsp; &nbsp; &nbsp; localhost.localdomain &nbsp; localhost eris</div></div>
<p>/etc/locale.gen</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">de_CH.UTF-8 UTF-8 &nbsp;<br />
de_CH ISO-8859-1</div></div>
<p>- Root-Passwort setzen.</p>
<p><em>7) Install Bootloader</em><br />
 Der Bootloader Grub wird auf <em>/dev/sda</em> installiert.</p>
<p><em>8 ) Exit Install</em></p>
<p>Danach startet man das Gerät neu:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># reboot</div></div>
<p>Das Minimalsystem von Arch Linux ist jetzt installiert. Viel Spass!</p>
<p><strong>Links</strong><br />
<a href="https://wiki.archlinux.org/index.php/LVM">https://wiki.archlinux.org/index.php/LVM</a></p>
 <p><a href="http://emanuelduss.ch/?flattrss_redirect&amp;id=356&amp;md5=fe808d7ac9bbd89992b8c066a2f9aeb0" title="Flattr" target="_blank"><img src="http://emanuelduss.ch/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://emanuelduss.ch/2011/03/arch-linux-grundinstallation-mit-lvm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="http://emanuelduss.ch/?flattrss_redirect&amp;id=356&amp;md5=fe808d7ac9bbd89992b8c066a2f9aeb0" type="text/html" />
	</item>
	</channel>
</rss>

