<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Fabian Moser &#187; HOWTO</title>
	<atom:link href="http://fabianmoser.at/schlagwort/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://fabianmoser.at</link>
	<description>&#34;as simple as possible, but not simpler&#34;</description>
	<lastBuildDate>Thu, 26 Jan 2012 13:19:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/at/</creativeCommons:license>		<item>
		<title>Eclipse CDT crash</title>
		<link>http://fabianmoser.at/blog/2011/04/25/eclipse-cdt-crash/</link>
		<comments>http://fabianmoser.at/blog/2011/04/25/eclipse-cdt-crash/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 20:28:00 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[CDT]]></category>
		<category><![CDATA[Crash]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[HOWTO]]></category>

		<guid isPermaLink="false">http://fabianmoser.at/?p=927</guid>
		<description><![CDATA[If you&#8217;re using the Eclipse CDT for C++ development and experience crashes immediately after loading the workspace (during indexing) on Linux (I saw it on Fedora and openSUSE), you should use the workaround suggested in the corresponding Bugzilla entry. Essentially &#8230; <a href="http://fabianmoser.at/blog/2011/04/25/eclipse-cdt-crash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using the Eclipse CDT for C++ development and experience crashes immediately after loading the workspace (during indexing) on Linux (I saw it on Fedora and openSUSE), you should use the workaround suggested in the <a href="https://bugzilla.redhat.com/show_bug.cgi?id=647737#c31" target="_blank">corresponding Bugzilla entry</a>. Essentially you have to add the line</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-XX:-UseCompressedOops</pre></div></div>

<p> to your <code>eclipse.ini</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2011/04/25/eclipse-cdt-crash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora Live USB with GRUB</title>
		<link>http://fabianmoser.at/blog/2011/02/25/fedora-live-usb-with-grub/</link>
		<comments>http://fabianmoser.at/blog/2011/02/25/fedora-live-usb-with-grub/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 09:59:25 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[GRUB]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://www.fabianmoser.at/?p=870</guid>
		<description><![CDATA[As already mentioned in my last post, my laptop won&#8217;t boot from a USB stick prepared using a binary copy of an ISO (by means of dd). Here is the method I use to boot the Fedora Live images off &#8230; <a href="http://fabianmoser.at/blog/2011/02/25/fedora-live-usb-with-grub/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As already mentioned in my <a href="http://www.fabianmoser.at/blog/2011/02/24/fedora-15-live-usb-for-hp-8440p/">last post</a>, my laptop won&#8217;t boot from a USB stick prepared using a binary copy of an ISO (by means of <code>dd</code>). Here is the method I use to boot the Fedora Live images off my USB stick using GNU GRUB2. The device node of the USB driver is denoted <code>/dev/sdX</code> in the following and must be replaced with the actual device node (e.g. <code>/dev/sdc</code>).</p>
<ol>
<li>Prepare a partition on the USB stick and/or make sure there is enough space on it (it must be slightly larger than the ISO image).</li>
<li>Make sure it is flagged bootable. ( <code>fdisk -l /dev/sdX</code> is your friend)</li>
<li>Remember the name of the USB partition you&#8217;re going to use or if unlabelled, label it.</li>
<li>Loop-mount the ISO image using something like <code>mount -o loop /path/to/iso /mnt/loop</code></li>
<li>Copy the content of the ISO over to the USB</li>
<li>Install GRUB on the USB by issuing <code>grub-install --no-floppy --root-directory=/mnt/usb /dev/sdX</code></li>
<li>Create a <code>/mnt/usb/boot/grub/grub.cfg</code> with the following content

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">menuentry &quot;Fedora Live&quot; {
 linux /isolinux/vmlinuz0 root=live:LABEL=XYZ rootfstype=auto ro liveimg quiet  rhgb rd_NO_LUKS rd_NO_MD rd_NO_DM
 initrd /isolinux/initrd0.img
}
&nbsp;
menuentry &quot;Fedora Live (Basic Video)&quot; {
 linux /isolinux/vmlinuz0 root=live:LABEL=XYZ rootfstype=auto ro liveimg quiet  rhgb rd_NO_LUKS rd_NO_MD rd_NO_DM xdriver=vesa nomodeset
 initrd /isolinux/initrd0.img
}</pre></div></div>

<p>where <code>XYZ</code> must be replaced by the actual partition name of your USB partition.</li>
<li>Unmount and boot</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2011/02/25/fedora-live-usb-with-grub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Firefox with AppArmor</title>
		<link>http://fabianmoser.at/blog/2010/09/24/secure-firefox-with-apparmor/</link>
		<comments>http://fabianmoser.at/blog/2010/09/24/secure-firefox-with-apparmor/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 16:00:59 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[AppArmor]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[PulseAudio]]></category>
		<category><![CDATA[Zotero]]></category>

		<guid isPermaLink="false">http://www.fabianmoser.at/?p=786</guid>
		<description><![CDATA[To &#8220;lock down&#8221; Firefox on an openSUSE 11.3 machine, I used the four AppArmor profiles you find below. The first is an openSUSE default profile and the second is based on the openSUSE default profile. My changes include support for &#8230; <a href="http://fabianmoser.at/blog/2010/09/24/secure-firefox-with-apparmor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To &#8220;lock down&#8221; Firefox on an openSUSE 11.3 machine, I used the four AppArmor profiles you find below. The first is an openSUSE default profile and the second is based on the openSUSE default profile. My changes include support for PulseAudio sound and the Flash plugin, where the latter is realized with local profiles that are stronger confined than Firefox itself. Finally, I added permission for Zotero requirements.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/apparmor.d/usr.lib.firefox.firefox.sh
&nbsp;
#include &lt;tunables/global&gt;
&nbsp;
/usr/lib/firefox/firefox.sh {
  #include &lt;abstractions/base&gt;
  #include &lt;abstractions/bash&gt;
  #include &lt;abstractions/consoles&gt;
&nbsp;
  deny capability sys_ptrace,
&nbsp;
  /bin/basename rix,
  /bin/bash rix,
  /bin/grep rix,
  /etc/magic r,
  /usr/bin/file rix,
  /usr/lib/firefox/firefox px,
  /usr/share/misc/magic.mgc r,
}</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/apparmor.d/usr.lib.firefox.firefox
&nbsp;
#include &lt;tunables/global&gt;
&nbsp;
/usr/lib/firefox/firefox {
  #include &lt;abstractions/base&gt;
  #include &lt;abstractions/bash&gt;
  #include &lt;abstractions/consoles&gt;
  #include &lt;abstractions/dbus&gt;
  #include &lt;abstractions/fonts&gt;
  #include &lt;abstractions/gnome&gt;
  #include &lt;abstractions/kde&gt;
  #include &lt;abstractions/nameservice&gt;
  #include &lt;abstractions/pulseaudio&gt;
  #include &lt;abstractions/user-download&gt;
  #include &lt;abstractions/user-write&gt;   
&nbsp;
  deny /usr/lib/firefox/firefox.sh x,
  deny /usr/lib/mozilla/extensions/*/ w,
&nbsp;
  /bin/bash ix,
  /bin/uname ix,
&nbsp;
  /etc/gai.conf r,
  /etc/gnome-vfs-2.0/modules/ r,
  /etc/gre.d/ r,
  /etc/gre.d/* r,
  /etc/mailcap r,
  /etc/mime.types r,
  /etc/mtab r,
  /etc/opt/kde3/share/applications/ r,
  /etc/opt/kde3/share/applications/mimeinfo.cache r,
&nbsp;
  owner @{HOME}/.ICEauthority r,
  owner @{HOME}/.beagle/ToIndex/* rw,
  owner @{HOME}/.fontconfig/* r,
  owner @{HOME}/.icons/ r,
  owner @{HOME}/.local/share/applications/ r,
  owner @{HOME}/.local/share/applications/* r,
  owner @{HOME}/.local/share/mime/* r,
  owner @{HOME}/.mozilla/extensions/** rw,
  owner @{HOME}/.mozilla/firefox/** rw,
  owner @{HOME}/.mozilla/firefox/**.sqlite* k,
  owner @{HOME}/.mozilla/firefox/**/.parentlock k,
&nbsp;
  /opt/kde3/share/applications/ r,
  /opt/kde3/share/applications/mimeinfo.cache r,
&nbsp;
  owner @{PROC}/*/mounts r,
  owner @{PROC}/*/fd/ r,
  @{PROC}/meminfo r,
  @{PROC}/sys/kernel/ngroups_max r,
&nbsp;
  /usr/bin/tr ix,
  /usr/bin/which ix,
&nbsp;
  /usr/lib/**.so mr,
  /usr/lib/firefox/firefox rix,
  /usr/lib/libproxy/pxgconf ix,
  /usr/lib/nspluginwrapper/*/linux/npviewer rcx -&gt; npviewer,
  /usr/lib/xulrunner-*/plugin-container cx -&gt; plugin_container,
&nbsp;
  /usr/local/share/applications/ r,
  /usr/local/share/applications/* r,
  /usr/share/applications/ r,
  /usr/share/applications/* r,
  /usr/share/gvfs/remote-volume-monitors/ r,
  /usr/share/gvfs/remote-volume-monitors/* r,
  /usr/share/locale-bundle/**.mo r,
  /usr/share/mime/**.xml r,
  /usr/share/mozilla/extensions/** r,
  /usr/share/myspell/* r,
&nbsp;
  /var/cache/gio-2.0/defaults.list r,
  /var/cache/libx11/compose/* r,
  owner /var/run/gdm/*/database r,
&nbsp;
  profile npviewer {
    #include &lt;abstractions/base&gt;
    #include &lt;abstractions/bash&gt;
    #include &lt;abstractions/consoles&gt;
&nbsp;
    /bin/bash rix,
    /bin/uname rix,
    /usr/bin/tr rix,
    /usr/bin/which rix,
    /usr/lib/nspluginwrapper/*/linux/npviewer.bin rix,
  }
&nbsp;
  profile plugin_container {
    #include &lt;abstractions/base&gt;
    #include &lt;abstractions/bash&gt;
    #include &lt;abstractions/consoles&gt;
    #include &lt;abstractions/gnome&gt;
    #include &lt;abstractions/pulseaudio&gt;
&nbsp;
    deny /etc/passwd r,
    deny @{PROC}/uptime r,
    deny @{HOME}/.mozilla/firefox/profiles.ini r,
&nbsp;
    /bin/bash ix,
    /bin/grep ix,
    /bin/ps ix,
&nbsp;
    owner @{PROC}/*/fd/ r,
    owner @{PROC}/*/stat r,
&nbsp;
    owner /var/run/gdm/*/database r,
    owner @{HOME}/.adobe/Flash_Player/**/ w,
    owner @{HOME}/.adobe/Flash_Player/AssetCache/ r,
    owner @{HOME}/.macromedia/Flash_Player/** rw,
  }
&nbsp;
  # Zotero-specific rules
  owner @{HOME}/.mozilla/firefox/*/zotero/pdfinfo-Linux-* cx -&gt; zotero_tools,
  owner @{HOME}/.mozilla/firefox/*/zotero/pdftotext-Linux-* cx -&gt; zotero_tools,
  owner @{HOME}/.zoteroIntegrationPipe rw,
  /usr/bin/evince Ux,
  /usr/bin/mkfifo ix,
  profile zotero_tools {
    #include &lt;abstractions/base&gt;
&nbsp;
    owner @{HOME}/.mozilla/firefox/*/zotero/storage/*/* r,
    owner @{HOME}/.mozilla/firefox/*/zotero/storage/*/.zotero-ft-info w,
    owner @{HOME}/.mozilla/firefox/*/zotero/storage/*/.zotero-ft-cache w,
  }
}</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/apparmor.d/abstractions/pulseaudio
&nbsp;
/dev/shm/ r,
owner /dev/shm/pulse-shm-* rw,
/dev/snd/*      rw,
&nbsp;
/etc/alsa-pulse.conf r,
/etc/asound-pulse.conf r,
/etc/pulse/client.conf r,
&nbsp;
owner @{HOME}/.pulse-cookie rwk,
&nbsp;
/usr/bin/pulseaudio px,
&nbsp;
/usr/share/alsa/** r,
/usr/share/sounds/** r,
&nbsp;
/var/lib/dbus/machine-id r,
&nbsp;
# vim:syntax=apparmor</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/apparmor.d/usr.bin.pulseaudio
&nbsp;
#include &lt;tunables/global&gt;
&nbsp;
/usr/bin/pulseaudio {
  #include &lt;abstractions/base&gt;
}</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2010/09/24/secure-firefox-with-apparmor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inkscape Standardvorlage</title>
		<link>http://fabianmoser.at/blog/2010/06/15/inkscape-standardvorlage/</link>
		<comments>http://fabianmoser.at/blog/2010/06/15/inkscape-standardvorlage/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 08:41:45 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Arbeit]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[EPS]]></category>
		<category><![CDATA[Grafik]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Vektorgrafik]]></category>

		<guid isPermaLink="false">http://www.fabianmoser.at/?p=671</guid>
		<description><![CDATA[Gestern war ich wieder einmal in der Situation, dass ich eine per Hand gezeichnete Skizze in einem Dokument verwenden wollte. In solchen Faellen ist Vektorgrafik Software Inkscape für mich die erste Wahl. In Inkscape angefertigte Zeichnungen lassen lassen sich ganz &#8230; <a href="http://fabianmoser.at/blog/2010/06/15/inkscape-standardvorlage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Gestern war ich wieder einmal in der Situation, dass ich eine per Hand gezeichnete Skizze in einem Dokument verwenden wollte. In solchen Faellen ist Vektorgrafik Software <a href="http://www.inkscape.org/">Inkscape</a> für mich die erste Wahl. In Inkscape angefertigte Zeichnungen lassen lassen sich ganz natürlich im EPS Format exportieren, das wiederum erste Wahl für Grafiken in LaTeX Dokumenten ist. Bei Bedarf lassen sich EPS Dateien auch unkompliziert in PDF umwandeln und mit pdfLaTeX verwenden.</p>
<p>Nun muss ich jedes Mal, wenn ich eine neue Zeichnung mit Inkscape beginnen wollte, zuerst eine Reihe von Dokumenteneinstellungen ändern, weil eine A4 Seite im Hochformat und mit Pixel Angaben auf den Linealen nicht das ist, was ich brauche. Stattdessen verwende ich immer A6 im Querformat mit Millimeter Angaben und einem 1mm Gitter. Die Vermutung, dass sich die Standardeinstellungen ändern lassen, bestätigte sich anhand eines <a href="http://wiki.inkscape.org/wiki/index.php/FAQ#Can_I_use_different_settings_for_the_new_documents_created_by_Inkscape.3F">Treffers in den Inkscape FAQ</a>.</p>
<p>Um es kurz zu machen: Man muss ein leeres Dokument nach den eigenen Vorstellungen erstellen und es als</p>
<pre>~/.config/inkscape/templates/default.de.svg</pre>
<p>speichern, wenn man, wie ich, Deutsch als Systemsprache verwendet.</p>
]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2010/06/15/inkscape-standardvorlage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Einrichtung eines sicheren Fileservers</title>
		<link>http://fabianmoser.at/blog/2010/02/28/einrichtung-eines-sicheren-fileservers/</link>
		<comments>http://fabianmoser.at/blog/2010/02/28/einrichtung-eines-sicheren-fileservers/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 11:15:13 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sicherheit]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://fabianmoser.at/?p=584</guid>
		<description><![CDATA[Theorie Bei diesem Titel versteht es sich vielleicht von selbst, dass FTP hier kein Thema ist. Es ist vermutlich zu einem nicht unwesentlichen Teil persönliche Präferenz, aber wenn ich das Wort sicher im Zusammenhang mit Servern verwende, verlasse ich mich &#8230; <a href="http://fabianmoser.at/blog/2010/02/28/einrichtung-eines-sicheren-fileservers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Theorie</h2>
<p>Bei diesem Titel versteht es sich vielleicht von selbst, dass FTP hier kein Thema ist. Es ist vermutlich zu einem nicht unwesentlichen Teil persönliche Präferenz, aber wenn ich das Wort sicher im Zusammenhang mit Servern verwende, verlasse ich mich immer gern auf SSH. Im Fall eines Fileservers bietet sich also das <a href="http://de.wikipedia.org/wiki/SSH_File_Transfer_Protocol">SFTP Protokoll</a> an. Generell wirft die Verwendung von SSH und, im Speziellen, die Weitergabe von Zugangsdaten für einen SSH Server (zumindest) zwei brennende Fragen auf.</p>
<p>Zum einen muss verhindert werden, dass der eingeloggte Benutzer beliebigen Code ausführen kann. Da er zumindest für das Upload Verzeichnis Schreibrechte hat, kann ein eventueller Upload von Exploits nicht prinzipiell verhindert werden, aber wenn man dem Benutzer erst gar keine Shell gibt, kann er die Ausführung des Schadcodes nicht veranlassen. Diese Strategie verfolgt die <a href="http://www.sublimation.org/scponly/wiki/index.php/Main_Page">scponly</a> Software.</p>
<p>Zum anderen ist man als Administator auch interessiert, dem eingeloggten Benutzer möglichst wenig Information über das System preiszugeben. Das erreicht man mit einer <code>chroot</code> Umgebung. Nun wird sogar von scponly ein Skript angeboten, um eine solche Umgebung zu erstellen. Dessen Verwendung wird auf der <a href="http://wiki.ubuntuusers.de/scponly">ubuntuusers Wiki</a> beschrieben. Leider ist dafür das Setzen des SUID Bits notwendig, was meiner Meinung nach keine saubere Lösung ist. Daher werde ich hier beschreiben, wie man eine äquivalente Umgebung mit dem <a href="http://www.floc.net/makejail/"><code>makejail</code></a> Skript erstellt. Diese Vorgehensweise orientiert sich stark an der <a href="http://www.debian.org/doc/manuals/securing-debian-howto/ap-chroot-ssh-env.de.html">Anleitung zum Absichern von Debian</a>, welche in ihrer Gesamtheit auf jeden Fall eine Lektüre wert ist, wenn man einen Debian Server administrieren muss.</p>
<h2>Praxis</h2>
<p>Diese Anleitung bezieht sich auf Debian Lenny. Zuerst werden die erforderlichen Pakete installiert:</p>
<pre># aptitude install libpam-chroot makejail scponly</pre>
<p>Nun wird das eben installierte PAM Modul <code>libpam-chroot</code> für SSH Logins aktiviert. Dazu werden die folgenden Zeilen zu der Datei <code>/etc/pam.d/sshd</code> hinzugefügt:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">session    required     pam_chroot.so</pre></div></div>

<p>Zunächst muss der entsprechende Benutzer erstellt werden, mit dem man sich später am Server anmelden kann.</p>
<pre># adduser --home /home/sftp --shell /usr/bin/scponly --no-create-home sftp</pre>
<p>Damit das PAM Modul auch wirklich greift, muss es für den neuen Benutzer aktiviert werden. Das geschieht durch folgende Zeile in der Datei <code>/etc/security/chroot.conf</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sftp	/var/chroot/users/sftp</pre></div></div>

<p>Als nächstes wird das Verzeichnis für die <code>chroot</code> Umgebung erstellt und der neue Benutzer erhält Schreibrechte für sein Heimatverzeichnis.</p>
<pre># mkdir -p /var/chroot/users/sftp/home/sftp
# chown sftp:sftp /var/chroot/users/sftp/home/sftp</pre>
<p>Für die Verwendung des <code>makejail</code> Skripts wird eine Konfigurationsdatei mit folgendem Inhalt erstellt und als <code>sftp-jail.py</code> gespeichert.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">chroot=<span style="color: #483d8b;">&quot;/var/chroot/users/sftp&quot;</span>
users=<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;sftp&quot;</span><span style="color: black;">&#93;</span>
testCommandsInsideJail=<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;scponly&quot;</span>, <span style="color: #483d8b;">&quot;ls&quot;</span>, <span style="color: #483d8b;">&quot;scp&quot;</span>, <span style="color: #483d8b;">&quot;rm&quot;</span>, <span style="color: #483d8b;">&quot;ln&quot;</span>, <span style="color: #483d8b;">&quot;mv&quot;</span>, <span style="color: #483d8b;">&quot;chmod&quot;</span>, <span style="color: #483d8b;">&quot;chown&quot;</span>, <span style="color: #483d8b;">&quot;chgrp&quot;</span>, <span style="color: #483d8b;">&quot;mkdir&quot;</span>, <span style="color: #483d8b;">&quot;rmdir&quot;</span>, <span style="color: #483d8b;">&quot;pwd&quot;</span>, <span style="color: #483d8b;">&quot;groups&quot;</span>, <span style="color: #483d8b;">&quot;id&quot;</span>, <span style="color: #483d8b;">&quot;echo&quot;</span>, <span style="color: #483d8b;">&quot;passwd&quot;</span><span style="color: black;">&#93;</span>
forceCopy=<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;/usr/lib/sftp-server&quot;</span><span style="color: black;">&#93;</span>
cleanJailFirst=<span style="color: #ff4500;">1</span>
preserve=<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;/home/sftp&quot;</span><span style="color: black;">&#93;</span></pre></div></div>

<p>Es folgt der Aufruf des Skripts.</p>
<pre># makejail sftp-jail.py</pre>
<p>Die am Ende ausgegebenen Warnungen können getrost ignoriert werden. Wenn man so vorsichtig ist wie ich, muss man noch dafür sorgen, dass der SSH Login für den neuen Benutzer freigegeben wird. Dazu fügt man den neuen Benutzernamen dem <code>AllowUsers</code> Parameter in der Datei <code>/etc/ssh/sshd_config</code> hinzu und startet das SSH Service neu.</p>
<pre># /etc/init.d/ssh restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2010/02/28/einrichtung-eines-sicheren-fileservers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling the suspend hotkey in KDE4</title>
		<link>http://fabianmoser.at/blog/2010/02/28/enabling-the-suspend-hotkey-in-kde4-2/</link>
		<comments>http://fabianmoser.at/blog/2010/02/28/enabling-the-suspend-hotkey-in-kde4-2/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 09:17:20 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Konfiguration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Thinkpad]]></category>

		<guid isPermaLink="false">http://fabianmoser.at/?p=576</guid>
		<description><![CDATA[There are several reports of problems with the suspend hotkey on KDE4 [1] [2]. And there is even a bug report on that issue. Naturally, I wouldn&#8217;t write about this if I hadn&#8217;t experienced the same problem myself. I solved &#8230; <a href="http://fabianmoser.at/blog/2010/02/28/enabling-the-suspend-hotkey-in-kde4-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are several reports of problems with the suspend hotkey on KDE4 <a title="Sleep Button in KDE 4 Workaround - Helpful Linux Tidbits" href="http://linuxtidbits.wordpress.com/2009/11/12/sleep-button-in-kde-4-workaround/">[1]</a> <a title="When PowerDevil does not recognize the suspend button in KDE 4.2" href="http://linuxbasement.com/content/when-powerdevil-does-not-recognize-suspend-button-kde-42">[2]</a>. And there is even a <a title="KDE Bug Tracking System" href="https://bugs.kde.org/show_bug.cgi?id=181444">bug report</a> on that issue. Naturally, I wouldn&#8217;t write about this if I hadn&#8217;t experienced the same problem myself. I solved it by slightly modifiying the approach described at <a href="http://linuxbasement.com/content/when-powerdevil-does-not-recognize-suspend-button-kde-42">Linux Basement</a>, avoiding the need to create a dedicated shell script somewhere.</p>
<p>This might not have been possible in KDE 4.2 (I haven&#8217;t verified), but it is in KDE SC 4.4. The Input Actions dialog (under System Settings) allows for the configuration of DBus calls from hotkeys. This was configured fast and works painless. I have exported the hotkey group and pasted the content below. To use it, save this as <code>PowerManagement.khotkeys</code> and import it in the Input Actions dialog.</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data<span style="">&#93;</span></span>
<span style="color: #000099;">DataCount</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1<span style="">&#93;</span></span>
<span style="color: #000099;">Comment</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Power management mappings of XF86 events</span>
<span style="color: #000099;">DataCount</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
<span style="color: #000099;">Enabled</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">true</span>
<span style="color: #000099;">Name</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Power Management</span>
<span style="color: #000099;">SystemGroup</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">Type</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">ACTION_DATA_GROUP</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1Conditions<span style="">&#93;</span></span>
<span style="color: #000099;">Comment</span><span style="color: #000066; font-weight:bold;">=</span>
<span style="color: #000099;">ConditionsCount</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1_1<span style="">&#93;</span></span>
<span style="color: #000099;">Comment</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Enables suspend hotkey</span>
<span style="color: #000099;">Enabled</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">true</span>
<span style="color: #000099;">Name</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Suspend</span>
<span style="color: #000099;">Type</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">SIMPLE_ACTION_DATA</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1_1Actions<span style="">&#93;</span></span>
<span style="color: #000099;">ActionsCount</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1_1Actions0<span style="">&#93;</span></span>
<span style="color: #000099;">Arguments</span><span style="color: #000066; font-weight:bold;">=</span>
<span style="color: #000099;">Call</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">org.freedesktop.PowerManagement.Suspend</span>
<span style="color: #000099;">RemoteApp</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">org.freedesktop.PowerManagement</span>
<span style="color: #000099;">RemoteObj</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">/org/freedesktop/PowerManagement</span>
<span style="color: #000099;">Type</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">DBUS</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1_1Conditions<span style="">&#93;</span></span>
<span style="color: #000099;">Comment</span><span style="color: #000066; font-weight:bold;">=</span>
<span style="color: #000099;">ConditionsCount</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1_1Triggers<span style="">&#93;</span></span>
<span style="color: #000099;">Comment</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Simple_action</span>
<span style="color: #000099;">TriggersCount</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Data_1_1Triggers0<span style="">&#93;</span></span>
<span style="color: #000099;">Key</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Sleep</span>
<span style="color: #000099;">Type</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">SHORTCUT</span>
<span style="color: #000099;">Uuid</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">&#123;</span>c1706a53-bde8-4364-b0af-71e9c1be6b3f<span style="">&#125;</span></span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Main<span style="">&#93;</span></span>
<span style="color: #000099;">AllowMerge</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">true</span>
<span style="color: #000099;">ImportId</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Power Management</span>
<span style="color: #000099;">Version</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">2</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2010/02/28/enabling-the-suspend-hotkey-in-kde4-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebDAV on Windows Vista &amp; Windows 7</title>
		<link>http://fabianmoser.at/blog/2009/09/30/webdav-on-windows-vista/</link>
		<comments>http://fabianmoser.at/blog/2009/09/30/webdav-on-windows-vista/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 13:25:43 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Laufwerk]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[WebDAV]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://fabianmoser.at/?p=457</guid>
		<description><![CDATA[There are quite a number of tales of woe around that topic. I had to find that out when I experienced some trouble myself today. If you&#8217;re in the same situation skip right down to the last two lines of &#8230; <a href="http://fabianmoser.at/blog/2009/09/30/webdav-on-windows-vista/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are quite a number of tales of woe around that topic. I had to find that out when I experienced some trouble myself today. If you&#8217;re in the same situation skip right down to the last two lines of this posting, the stuff in between just details the problem to associate the solution to the problem for the search engines.</p>
<p>My intention was to connect to my freshly set up  WebDAV directory served by Apache. The setup on the server side was quite tedious as well, but as expected, there are countless howtos around and one just has to put the pieces together as usual. The real problem however arose, when I starry-eyed tried to connect to that online directory using Vista&#8217;s &#8220;Map Network Drive &#8230;&#8221; dialog. After some steps into the wizard that always gave me the error popup saying &#8220;The folder you entered does not appear to be valid&#8221;.</p>
<p>Well that soon let me drop to the beloved command line. But using <code>net use W: https://example.com/davroot</code> was answered by &#8220;System error 67 has occurred&#8221; and &#8220;The network name cannot be found&#8221;. Using <code>net use W: \\example.com@SSL\davroot</code> gave no improvement.</p>
<p>I will spare you my other trials and all the different possible solutions that can be found on the net (I even installed a Microsoft patch which didn&#8217;t change anything) and write down straight what solved the problem:</p>
<ol>
<li><strong>Make sure the &#8220;WebClient&#8221; service is running!</strong> (Type &#8220;services.msc&#8221; into the search box in the start menu and hit enter.  Scroll down the WebClient and check.)</li>
<li><strong>Use &#8220;\\yourserver@SSL\DavWWWRoot\yourshare&#8221; as the server address</strong> in the Folder field of the Map Network Drive dialog box. Do not forget the DavWWWRoot or the @SSL.  <strong> </strong><strong> </strong></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2009/09/30/webdav-on-windows-vista/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How-to reduce fail2ban memory usage</title>
		<link>http://fabianmoser.at/blog/2009/05/15/how-to-reduce-fail2ban-memory-usage/</link>
		<comments>http://fabianmoser.at/blog/2009/05/15/how-to-reduce-fail2ban-memory-usage/#comments</comments>
		<pubDate>Fri, 15 May 2009 11:14:05 +0000</pubDate>
		<dc:creator>Fabian Moser</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.fabianmoser.at/?p=387</guid>
		<description><![CDATA[This morning, when I did the routinely scan of the server&#8217;s resource usage history, I noticed a suspicious network activity between 1 and 5 am. Some reading of the latest log files soon identified the traffic to have been caused &#8230; <a href="http://fabianmoser.at/blog/2009/05/15/how-to-reduce-fail2ban-memory-usage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This morning, when I did the routinely scan of the server&#8217;s resource usage history, I noticed a suspicious network activity between 1 and 5 am. Some reading of the latest log files soon identified the traffic to have been caused by a dictionary attack on my SSH server. I took the opportunity to extend my current setup for the <a href="http://debaday.debian.net/2007/04/29/fail2ban-an-enemy-of-script-kiddies/">script-kiddie enemy</a> called <a href="http://www.fail2ban.org">fail2ban</a>. This program monitors potentially any service&#8217;s log file for failed login attempts and if their number exceeds a certain limit, it blocks the issuing host using <a href="http://www.netfilter.org/">iptables</a> rules.</p>
<p>Unfortunately the first start of the new service turned out to blow up the memory usage by about 100 MB which is unacceptable regarding the tight resources of my virtual private server. As I found out, <a href="http://www.supersoftcafe.com/2009/04/09/vps-configuration">others</a> had similar experience and switched to <a href="http://denyhosts.sourceforge.net/">DenyHosts</a> due to this issue. My experience with setting up <a href="http://trac.edgewall.org/">Trac</a> two weeks ago taught me that a Python application (like fain2ban) might consume a lot of memory only because of the relatively oversized default stack size on Linux.</p>
<p>The means to reduce the default stack size in Linux are widely known to be the limits.conf file and the ulimit command. But how to use those two in my situation? The solution turns out to be a one-liner on Debian Lenny: All I had to do was to append the ulimit command to my /etc/default/fail2ban file.</p>
<p>This is the changed /etc/default/fail2ban file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># This file is part of Fail2Ban.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Fail2Ban is free software; you can redistribute it and/or modify</span>
<span style="color: #666666; font-style: italic;"># it under the terms of the GNU General Public License as published by</span>
<span style="color: #666666; font-style: italic;"># the Free Software Foundation; either version 2 of the License, or</span>
<span style="color: #666666; font-style: italic;"># (at your option) any later version.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Fail2Ban is distributed in the hope that it will be useful,</span>
<span style="color: #666666; font-style: italic;"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #666666; font-style: italic;"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span style="color: #666666; font-style: italic;"># GNU General Public License for more details.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You should have received a copy of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;"># along with Fail2Ban; if not, write to the Free Software</span>
<span style="color: #666666; font-style: italic;"># Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Author: Cyril Jaquier</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># $Revision: 1.2 $</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Command line options for Fail2Ban. Refer to &quot;fail2ban-client -h&quot; for</span>
<span style="color: #666666; font-style: italic;"># valid options.</span>
&nbsp;
<span style="color: #007800;">FAIL2BAN_OPTS</span>=<span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">ulimit</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">256</span></pre></div></div>

<p>Using this sets the default stack size for the Python instances running fail2ban to 256 KB and lowers the memory consumption of fail2ban approximately by a factor of 10.</p>
]]></content:encoded>
			<wfw:commentRss>http://fabianmoser.at/blog/2009/05/15/how-to-reduce-fail2ban-memory-usage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

