<?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>johker&#039;s blog &#187; vimrc</title>
	<atom:link href="http://johker.ibutho.de/tag/vimrc/feed/" rel="self" type="application/rss+xml" />
	<link>http://johker.ibutho.de</link>
	<description>stories about me, my life and my trips</description>
	<lastBuildDate>Sun, 18 Dec 2011 11:53:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Der neue Server: Teil 1 Installation und Basiskonfiguration</title>
		<link>http://johker.ibutho.de/2009/03/17/der-neue-server-teil-1-installation-und-basiskonfiguration/</link>
		<comments>http://johker.ibutho.de/2009/03/17/der-neue-server-teil-1-installation-und-basiskonfiguration/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 19:32:06 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[adduser]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[apticron]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[bash_aliases]]></category>
		<category><![CDATA[benachrichtigung]]></category>
		<category><![CDATA[completion]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[dateizugriff]]></category>
		<category><![CDATA[dist-upgrade]]></category>
		<category><![CDATA[DoS]]></category>
		<category><![CDATA[dpkg-reconfigure]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[findutils]]></category>
		<category><![CDATA[hetzner]]></category>
		<category><![CDATA[htop]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[locate]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mc]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[midnight commander]]></category>
		<category><![CDATA[ncurses]]></category>
		<category><![CDATA[partitionierung]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[rescue-system]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[smart]]></category>
		<category><![CDATA[smartmontools]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[updatedb]]></category>
		<category><![CDATA[useradd]]></category>
		<category><![CDATA[vimrc]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=102</guid>
		<description><![CDATA[Seit ca. November letzten Jahres war klar, dass ein neuer Server her muss &#8211; nicht zuletzt, weil einige Leute bei ibutho ausgestiegen sind und ibutho doch etwas zu schwach ist für unsere Ansprüche. Die Planungen liefen auch schon seit Ende &#8230; <a href="http://johker.ibutho.de/2009/03/17/der-neue-server-teil-1-installation-und-basiskonfiguration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Seit ca. November letzten Jahres war klar, dass ein neuer Server her muss &#8211; nicht zuletzt, weil einige Leute bei ibutho ausgestiegen sind und ibutho doch etwas zu schwach ist für unsere Ansprüche. Die Planungen liefen auch schon seit Ende letzten Jahres und nun haben sie alle Gestalt angenommen. Die Domains werden alle zentral über <a href="http://www.inwx.de/" target="_blank">inwx.de</a> verwaltet. Dies hat den Vorteil, dass wir unabhängig vom Provider des Root-Servers sind und später ohne Probleme wechseln können. Beim Server haben wir uns für einen <a href="http://www.hetzner.de/hosting/produkte_rootserver/ds3000/" target="_blank">DS3000</a> von <a href="http://hetzner.de" target="_blank">Hetzner</a> entschieden. Dieser sagte uns sowohl von den Hardware-Daten als auch vom Preis-/Leistungsverhältnis zu (AMD Athlon 64 X2 5600+, 2GB RAM, 2 x 400GB Festplatte, 100MBit Anbindung ans Internet, 7 IP-Adressen, unbegrenzter Traffic).</p>
<p>Im Weiteren will ich auf die Grundinstallation eingehen und in den folgenden Teilen auf die beispielhafte Installation und Konfiguration verschiedenster Server-Dienste. Ich hoffe, dass diese Beiträge für den ein oder anderen nützlich sind, wenn sie ihren eigenen Server konfigurieren und absichern wollen. Ich bitte um rege Diskussionen, damit die Beiträge sinnvoll erweitert und Fehler beseitigt werden können.</p>
<h1>Installation des Systems</h1>
<p>Hetzner vereinfacht dem Administrator die Installation eines eigenen Betriebssystems über das Rescue-System sehr. Es wir ein Skript installimage angeboten, über welches man z.B. die Festplatte partitionieren kann, ein LVM einrichten kann oder einen Software-RAID konfigurieren kann.</p>
<p>Bei meiner Installation entschied ich mich für ein RAID1-System mit LVM. Für RAID1 entschied ich mich aufgrund der gesteigerten Ausfallsicherheit und der gesteigerten Lese-Performance. Für LVM entschied ich mich, da dies mehr Flexibilität mit sich bringt als ein starres Partitionsschema. Sollte man später bemerken, dass eine Volume zu groß oder zu klein ist, kann man es einfach verkleinern/vergrößern. Versierte Leser mögen sich hier fragen, warum ich nicht komplett auf ein LVM-Setup setze und dem LVM auch das Mirroring überlasse. Der Grund ist einfach: über ein Software-RAID erhalte ich höhere Leseraten (siehe auch: <a href="http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1/" target="_blank">http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1/</a>, insbesondere auch die Kommentare). Beim Dateisystem setze ich auf ext3 bzw. ext2 für &#8220;/boot&#8221;, da sich ext3 im LVM problemlos im laufenden Betrieb vergrößern bzw. verkleinern lässt.</p>
<p>Hier mein Partitionslayout:</p>
<table border="1" cellspacing="0" cellpadding="4" width="100%" bordercolor="#000000">
<col width="55"></col>
<col width="55"></col>
<col width="71"></col>
<col width="75"></col>
<tbody>
<tr valign="top">
<td colspan="2" width="43%" height="17" bgcolor="#e6e6e6">Mountpunkt</td>
<td width="28%" bgcolor="#e6e6e6">Dateisystem</td>
<td width="29%" bgcolor="#e6e6e6">Größe</td>
</tr>
<tr valign="top">
<td colspan="2" width="43%" height="18">/boot</td>
<td width="28%">ext2</td>
<td width="29%">256M</td>
</tr>
<tr valign="top">
<td colspan="2" width="43%" height="18">vg0</td>
<td width="28%">lvm</td>
<td width="29%">all</td>
</tr>
<tr valign="top">
<td width="21%" height="18"></td>
<td width="21%">swap</td>
<td width="28%">swap</td>
<td width="29%">2G</td>
</tr>
<tr valign="top">
<td width="21%" height="18"></td>
<td width="21%">/</td>
<td width="28%">ext3</td>
<td width="29%">5G</td>
</tr>
<tr valign="top">
<td width="21%" height="18"></td>
<td width="21%">/home</td>
<td width="28%">ext3</td>
<td width="29%">15G</td>
</tr>
<tr valign="top">
<td width="21%" height="18"></td>
<td width="21%">/tmp</td>
<td width="28%">ext3</td>
<td width="29%">4G</td>
</tr>
<tr valign="top">
<td width="21%" height="17"></td>
<td width="21%">/var</td>
<td width="28%">ext3</td>
<td width="29%">50G</td>
</tr>
</tbody>
</table>
<p>Sowohl &#8220;/boot&#8221;, als auch &#8220;vg0&#8243; sind jeweils eine RAID1-Partition. Die ganze Arbeit das RAID einzurichten und danach das LVM hat mir das hetzner-Skript abgenommen.</p>
<h1>Erste Schritte</h1>
<h2>aptitude-Mirror konfigurieren</h2>
<p>Hetzner stellt einen eigenen aptitude-/apt-Mirror und diesen werden wir als allererstes ändern. Die Vorteile liegen auf der Hand: hohe Übertragungsraten und es handelt sich um internen Traffic, wird als nicht berechnet.</p>
<p>/etc/apt/sources.list:</p>

<div class="wp_syntax"><div class="code"><pre class="apt_sources" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># Packages and Security Updates from the Hetzner Debian Mirror</span>
<span style="color: #00007f;">deb</span> <span style="color: #009900;">ftp://mirror.hetzner.de/debian/packages</span>  <span style="color: #b1b100;">lenny</span>          <span style="color: #b16000;">main</span> <span style="color: #b16000;">contrib</span> <span style="color: #b16000;">non-free</span>
<span style="color: #00007f;">deb</span> <span style="color: #009900;">ftp://mirror.hetzner.de/debian/security</span>  <span style="color: #b1b100;">lenny</span>/updates  <span style="color: #b16000;">main</span> <span style="color: #b16000;">contrib</span> <span style="color: #b16000;">non-free</span></pre></div></div>

<p>Und nun ein erstes Update&amp;Upgrade:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> update <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #c20cb9; font-weight: bold;">aptitude</span> dist-upgrade</pre></div></div>

<h2>postfix Installation</h2>
<p>Da <em>postfix</em> der Mailserver meiner Wahl ist und ich nicht will, dass irgend ein Programm <em>exim</em> oder ähnliches installiert, werden wir jetzt gleich postfix installieren, jedoch noch nicht konfigurieren. Die Konfiguration folgt ausführlich in einem weiteren Teil.</p>

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

<h2>Systemtools</h2>
<h3>apticron</h3>
<p>apticron ist ein Tool, welches einen per Mail informiert, wenn es Updates gibt. Dies ist besonders hilfreich, da das Tool die Paketquellen im Hintergrund updated, aber die Updates nicht einspielt; so bleibt es dem Administrator immer selbst überlassen, welche Pakete er einspielt und welche nicht, bzw. welche er erst ausführlicher testen will, da die Funktionalität des Systems evtl. erheblich beeinträchtigt werden könnte.</p>

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

<h3>mdadm</h3>
<p>Mit <em>mdadm</em> wurde bereits das Software-RAID erstellt. Doch <em>mdadm</em> kann mehr: es kann den Benutzer auch per E-Mail informieren, wenn es Probleme mit dem RAID gibt. Dies wollen wir hier einstellen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dpkg-reconfigure mdadm</pre></div></div>

<h3>smartmontools</h3>
<p>Mit den <em>smartmontools</em> kann man den Status des Festplatten abfragen und bekommt E-Mails, wenn die Festplatte kurz vor ihrem Lebensende ist.</p>

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

<p><em>/etc/default/smartmontools</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># uncomment to start smartd on system startup</span>
<span style="color: #007800;">start_smartd</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># uncomment to pass additional options to smartd on startup</span>
<span style="color: #007800;">smartd_opts</span>=<span style="color: #ff0000;">&quot;--interval=1800&quot;</span></pre></div></div>

<p><em>/etc/smartd.conf</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">DEVICESCAN <span style="color: #660033;">-m</span> root <span style="color: #660033;">-M</span> <span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>smartmontools<span style="color: #000000; font-weight: bold;">/</span>smartd-runner</pre></div></div>

<h3>htop</h3>
<p><em>htop</em> ist eine erweiterte Version von <em>top</em> und bietet eine ncurses-Oberfläche, sowie Farben und &#8220;grafische&#8221; Anzeigen.</p>

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

<h3>lsof</h3>
<p><em>lsof</em> kann anzeigen, wer gerade auf einen Ordner/Gerät zugreift. Das Tool kann nützlich sein, wenn man einen Ordner unmounten will, aber noch jemand/etwas darauf zugreift.</p>

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

<h3>mc</h3>
<p>Wer DOS noch kennt, kennt auch den <em>Norton Commander</em>. <em>mc</em> (ausgeschrieben: midnight commander) ist ein <em>Norton Commander</em>-Klon und vereinfacht einem das Leben in vielen Situationen. Einfach mal ausprobieren:</p>

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

<h3>locate</h3>
<p>Mit <em>locate</em> kann man schnell nach Dateien suchen. Es baut einen Index über Dateien und Ordner des Dateisystems auf und aktualisiert diesen mittels eines Cronjobs regelmäßig. Sucht man eine Datei, so gibt man einfach folgendes ein:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">locate</span> <span style="color: #000000; font-weight: bold;">&lt;</span>Dateiname<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Das Paket kann mit folgendem Befehl installiert werden:</p>

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

<p>Nach der Installation sollte als Erstes der Index aufgebaut werden (dies wird später automatisch gemacht):</p>

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

<h2>Benutzer anlegen</h2>
<p>Meine Anforderung an die Home-Laufwerke der einzelnen Benutzer ist, dass sie nicht von jedem gelesen werden können, aber dass man trotzdem Ordner/Dateien unterhalb des eigenen Home-Laufwerks für andere zugänglich machen kann, um z.B. einen &#8220;Briefkasten&#8221; zu implementieren, wo andere Benutzer Dateien für einen ablegen können, aber nicht sehen können, was sich sonst noch darin befindet. Deshalb wird mit folgenden Befehl die Sichtbarkeit der Home-Verzeichnisse geändert:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dpkg-reconfigure adduser</pre></div></div>

<p>Außerdem hätte ich gerne, dass jeder Benutzer standardmäßig in der Gruppe &#8220;users&#8221; ist (man weiß ja nie, wozu das noch gut sein könnte). Dazu fügen wir an die Datei &#8220;<em>/etc/default/useradd</em>&#8221; am Ende folgendes an &#8211; bzw. an die Datei &#8220;<em>/etc/adduser.conf</em>&#8221; (je nachdem, ob man <em>adduser</em> oder <em>useradd</em> zum Hinzufügen von Benutzern verwendet):<br />
<em>/etc/default/useradd</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">GROUPS</span>=<span style="color: #c20cb9; font-weight: bold;">users</span></pre></div></div>

<p><em>/etc/adduser.conf</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">EXTRA_GROUPS</span>=<span style="color: #ff0000;">&quot;users&quot;</span>
<span style="color: #007800;">ADD_EXTRA_GROUPS</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>Die &#8220;Briefkasten&#8221;-Erweiterung:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>skel<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> public
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> public<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> public<span style="color: #000000; font-weight: bold;">/</span>dropbox
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">753</span> public<span style="color: #000000; font-weight: bold;">/</span>dropbox<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> root: public<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-R</span></pre></div></div>

<p>Nun legen wir noch eigene Versionen der Dateien .vimrc, .bashrc, .bash_aliases in &#8220;<em>/etc/skel/</em>&#8220;:<br />
<em>.vimrc</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;">sy <span style="color: #25BB4D;">on</span>
se <span style="color: #668080;">nu</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">incsearch</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">hlsearch</span>
<span style="color: #804040;">colorscheme</span> slate</pre></div></div>

<p><em>.bashrc</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~/.bashrc: executed by bash(1) for non-login shells.</span>
<span style="color: #666666; font-style: italic;"># see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)</span>
<span style="color: #666666; font-style: italic;"># for examples</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">'\h:\w\$ '</span>
<span style="color: #7a0874; font-weight: bold;">umask</span> 022
&nbsp;
<span style="color: #666666; font-style: italic;"># If not running interactively, don't do anything</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;">$PS1</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #7a0874; font-weight: bold;">return</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># don't put duplicate lines in the history. See bash(1) for more options</span>
<span style="color: #666666; font-style: italic;"># don't overwrite GNU Midnight Commander's setting of `ignorespace'.</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=<span style="color: #007800;">$HISTCONTROL</span><span style="color: #800000;">${HISTCONTROL+,}</span>ignoredups
<span style="color: #666666; font-style: italic;"># ... or force ignoredups and ignorespace</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignoreboth
&nbsp;
<span style="color: #666666; font-style: italic;"># append to the history file, don't overwrite it</span>
<span style="color: #7a0874; font-weight: bold;">shopt</span> <span style="color: #660033;">-s</span> histappend
&nbsp;
<span style="color: #666666; font-style: italic;"># for setting history length see HISTSIZE and HISTFILESIZE in bash(1)</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># check the window size after each command and, if necessary,</span>
<span style="color: #666666; font-style: italic;"># update the values of LINES and COLUMNS.</span>
<span style="color: #7a0874; font-weight: bold;">shopt</span> <span style="color: #660033;">-s</span> checkwinsize
&nbsp;
<span style="color: #666666; font-style: italic;"># make less more friendly for non-text input files, see lesspipe(1)</span>
<span style="color: #666666; font-style: italic;">#[ -x /usr/bin/lesspipe ] &amp;amp;&amp;amp; eval &quot;$(SHELL=/bin/sh lesspipe)&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># set variable identifying the chroot you work in (used in the prompt below)</span>
<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;">$debian_chroot</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>debian_chroot <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">debian_chroot</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>debian_chroot<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># set a fancy prompt (non-color, unless we know we &quot;want&quot; color)</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TERM</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    xterm-color<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">color_prompt</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># uncomment for a colored prompt, if the terminal has the capability; turned</span>
<span style="color: #666666; font-style: italic;"># off by default to not distract the user: the focus in a terminal window</span>
<span style="color: #666666; font-style: italic;"># should be on the output of commands, not on the prompt</span>
<span style="color: #666666; font-style: italic;">#force_color_prompt=yes</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$force_color_prompt</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>tput <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; tput setaf <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #666666; font-style: italic;"># We have color support; assume it's compliant with Ecma-48</span>
        <span style="color: #666666; font-style: italic;"># (ISO/IEC-6429). (Lack of such support is extremely rare, and such</span>
        <span style="color: #666666; font-style: italic;"># a case would tend to support setf rather than setaf.)</span>
        <span style="color: #007800;">color_prompt</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #007800;">color_prompt</span>=
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$color_prompt</span>&quot;</span> = <span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">'${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">'${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">unset</span> color_prompt force_color_prompt
&nbsp;
<span style="color: #666666; font-style: italic;"># If this is an xterm set the title to user@host:dir</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TERM</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
xterm<span style="color: #000000; font-weight: bold;">*|</span>rxvt<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;\[\e]0;<span style="color: #007800;">${debian_chroot:+($debian_chroot)}</span>\u@\h: \w\a\]<span style="color: #007800;">$PS1</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Alias definitions.</span>
<span style="color: #666666; font-style: italic;"># You may want to put all your additions into a separate file like</span>
<span style="color: #666666; font-style: italic;"># ~/.bash_aliases, instead of adding them here directly.</span>
<span style="color: #666666; font-style: italic;"># See /usr/share/doc/bash-doc/examples in the bash-doc package.</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_aliases <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    . ~<span style="color: #000000; font-weight: bold;">/</span>.bash_aliases
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># enable color support of ls and also add handy aliases</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">dircolors</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`dircolors -b`</span>&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">ls</span>=<span style="color: #ff0000;">'ls --color=auto'</span>
    <span style="color: #666666; font-style: italic;">#alias dir='dir --color=auto'</span>
    <span style="color: #666666; font-style: italic;">#alias vdir='vdir --color=auto'</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">#alias grep='grep --color=auto'</span>
    <span style="color: #666666; font-style: italic;">#alias fgrep='fgrep --color=auto'</span>
    <span style="color: #666666; font-style: italic;">#alias egrep='egrep --color=auto'</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># some more ls aliases</span>
<span style="color: #666666; font-style: italic;">#alias ll='ls -l'</span>
<span style="color: #666666; font-style: italic;">#alias la='ls -A'</span>
<span style="color: #666666; font-style: italic;">#alias l='ls -CF'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># enable programmable completion features (you don't need to enable</span>
<span style="color: #666666; font-style: italic;"># this, if it's already enabled in /etc/bash.bashrc and /etc/profile</span>
<span style="color: #666666; font-style: italic;"># sources /etc/bash.bashrc).</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>bash_completion <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    . <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>bash_completion
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p><em>.bash_aliases</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">l</span>=<span style="color: #ff0000;">'ls -lA'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">ll</span>=<span style="color: #ff0000;">'ls -l'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">la</span>=<span style="color: #ff0000;">'ls -a'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lla</span>=<span style="color: #ff0000;">'ls -la'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lal</span>=<span style="color: #ff0000;">'ls -la'</span></pre></div></div>

<p>Zusätzlich installieren wir noch das Paket &#8220;bash-completion&#8221;, um eine komplexere Code- und Befehlsvervollständigung zu bekommen (wird erst nach erneutem Anmelden an der Konsole aktiv):</p>

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

<p>Nun können wir mittels adduser einen Benutzer anlegen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #000000; font-weight: bold;">&lt;</span>Benutzername<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/03/17/der-neue-server-teil-1-installation-und-basiskonfiguration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

