<?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> &#187; cartas náuticas</title>
	<atom:link href="http://www.laestacionerrante.com/archives/category/cartas-nauticas/feed" rel="self" type="application/rss+xml" />
	<link>http://www.laestacionerrante.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Jun 2010 11:36:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://www.laestacionerrante.com</link>
  <url>http://www.laestacionerrante.com/wp-content/images/favicon/favicon.ico</url>
  <title></title>
</image>
		<item>
		<title>UUID: Una Buena Solución Para Evitar Problemas de Montaje</title>
		<link>http://www.laestacionerrante.com/archives/683</link>
		<comments>http://www.laestacionerrante.com/archives/683#comments</comments>
		<pubDate>Fri, 01 Jan 2010 15:04:10 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=683</guid>
		<description><![CDATA[A veces, incluir un nuevo disco duro en nuestro servidor puede ser cuanto menos una odisea. Me refiero al hecho de que en alguna ocasión el sistema renombra los /dev/sdxx de nuevo, con un orden distinto al que había antes. Esto, como es lógico supone un problema de montaje. La solución es bastante sencilla. Basta [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p style="text-align: justify;">A veces, incluir un nuevo disco duro en nuestro servidor puede ser cuanto menos una odisea. Me refiero al hecho de que en alguna ocasión el sistema renombra los <em>/dev/sdxx</em> de nuevo, con un orden distinto al que había antes. Esto, como es lógico supone un problema de montaje. La solución es bastante sencilla. Basta con reconfigurar el archivo <em>fstab</em>, cambiando los <em>/dev/sdxx</em> de cada disco duro por su UUID.</p>
<p style="text-align: justify;">Para averiguar el UUID de cada disco duro:</p>
<p style="text-align: justify;"><em><span style="color: #800000;"># blkid</span></em></p>
<p style="text-align: justify;">Arrojará algo como esto:</p>
<p><em><span style="color: #808080;">/dev/sda1: UUID=&#8221;7ae64ce1-cd96-459d-ab78-5ad34b475660&#8243; TYPE=&#8221;ext3&#8243;<br />
/dev/sda5: TYPE=&#8221;swap&#8221;<br />
/dev/sda6: UUID=&#8221;cf8ce289-0418-456a-952b-707750728f25&#8243; TYPE=&#8221;ext3&#8243;</span></em></p>
<p>Como vemos la partición <em>swap</em> no ha sido mostrada. Para que se nos muestre la partición <em>swap</em>:</p>
<p><em><span style="color: #800000;"># swapoff -a</span></em></p>
<p><em><span style="color: #800000;"># mkswap /dev/sda5</span></em></p>
<p><span style="color: #808080;"><em>Configurando espacio de intercambio versión 1, tamaño = 3043315 kB<br />
no label, UUID=50ebe50e-a41f-42db-bb7b-4ee5d4ef021e</em></span></p>
<p><em><span style="color: #800000;"># swapon -a</span></em></p>
<p>(donde /dev/sda5 es la partición <em>swap</em> en el ejemplo)</p>
<p>Ahora cada vez que usemos el comando <em><span style="color: #800000;">blkid</span></em> nos mostrará también el UUID de la partición <em>swap</em>.</p>
<p><em><span style="color: #800000;"># blkid</span></em></p>
<p><span style="color: #808080;"><em>/dev/sda1: UUID=&#8221;7ae64ce1-cd96-459d-ab78-5ad34b475660&#8243; TYPE=&#8221;ext3&#8243;<br />
/dev/sda5: TYPE=&#8221;swap&#8221; UUID=&#8221;50ebe50e-a41f-42db-bb7b-4ee5d4ef021e&#8221;<br />
/dev/sda6: UUID=&#8221;cf8ce289-0418-456a-952b-707750728f25&#8243; TYPE=&#8221;ext3&#8243;</em></span></p>
<p><span style="color: #800000;"><span style="color: #000000;">Luego debemos modificar el alchivo fstab sustituyendo el nombre de las particiones /dev/sdxx por el del UUID de forma que queda algo como lo siguiente:</span></span></p>
<p><em><span style="color: #800000;"># nano /etc/fstab</span></em></p>
<p><span style="color: #808080;"><em># /etc/fstab: static file system information.<br />
#<br />
# &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;<br />
proc            /proc           proc    defaults        0       0<br />
UUID=<em>7ae64ce1-cd96-459d-ab78-5ad34b475660</em> /               ext3    errors=remount-ro 0       1<br />
UUID=<em>cf8ce289-0418-456a-952b-707750728f25</em> /home           ext3    defaults        0       2<br />
UUID=<em>50ebe50e-a41f-42db-bb7b-4ee5d4ef021e</em> none            swap    sw              0       0<br />
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0<br />
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0</em></span></p>
<p><span style="color: #800000;"><span style="color: #000000;">Ahora ya no importa si conectamos un nuevo disco duro al servidor.<br />
</span></span></p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/683/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cambio de Placa Base en el Servidor</title>
		<link>http://www.laestacionerrante.com/archives/671</link>
		<comments>http://www.laestacionerrante.com/archives/671#comments</comments>
		<pubDate>Tue, 29 Dec 2009 09:09:04 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=671</guid>
		<description><![CDATA[Hace poco tuve un problema con el servidor: kernel panic. Después de googlear un poco, averigué que todo apuntaba a un fallo de memoria. La odisea para intentar depurar el error fue muy engorrosa, y aunque me olía que uno de los módulos podía estar dañado, no acabé de confiar y decidí cambiar la placa [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p style="text-align: justify;">Hace poco tuve un problema con el servidor: kernel panic. Después de googlear un poco, averigué que todo apuntaba a un fallo de memoria. La odisea para intentar depurar el error fue muy engorrosa, y aunque me olía que uno de los módulos podía estar dañado, no acabé de confiar y decidí cambiar la placa base (Asus P5QC por una Aus P5K-E). En realidad era del otro pc que tengo en casa. Mantuve el procesador (un poco más veloz que el del servidor aunque también Core 2 Duo) y mantuve la memoria instalada (2G+2G). ¿Como lo hice? pues &#8220;a las bravas&#8221; que dirían por México: cambié todo diréctamente y arranqué el servidor. Inició perfecto sin fallo aparente, aunque un diagnóstico posterior sacó a relucir un error en la conexión a internet (fallo de la tarjeta de red). De hecho fue lo único que no reconoció, lo demás (puertos usb, pci, controlador sata, etc) lo reconoció sin problemas. Sin embargo un análisis posterior arrojó la conclusión de que en realidad sí reconoció la tarjeta de red, pero la renombró como eth2 en lugar de eth0.</p>
<p style="text-align: justify;">Basandome en las indicaciones de <a href="http://diegoacosta.net/index.php/2009/09/reconfiguracion-de-nombre-de-tarjeta-de-red-en-debian/" target="_blank">diegoacosta</a> busqué en el directorio <strong>/etc/udev/rules.d/</strong> el fichero correspondiente a la configuración de red de mi servidor (/etc/udev/rules.d/70-persistent-net.rules) que contenía la siguiente información:</p>
<p style="text-align: left;"><span style="color: #888888;"><em># PCI device 0&#215;1969:0&#215;1026 (ATL1E)<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:22:&#8230;&#8230;&#8230;&#8221;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;eth*&#8221;, NAME=&#8221;eth0&#8243;</em></span></p>
<p style="text-align: left;"><span style="color: #888888;"><em># Firewire device  (nodemgr)<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:1e:</em><em>&#8230;&#8230;&#8230;</em><em>&#8220;, ATTR{type}==&#8221;24&#8243;, KERNEL==&#8221;eth*&#8221;, NAME=&#8221;eth1&#8243;</em></span></p>
<p style="text-align: left;"><span style="color: #888888;"><em># PCI device 0&#215;11ab:0&#215;4364 (sky2)<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:1d:</em><em>&#8230;&#8230;&#8230;</em><em>&#8220;, ATTR{dev_id}==&#8221;0&#215;0&#8243;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;eth*&#8221;, NAME=&#8221;eth2&#8243;</em></span></p>
<p style="text-align: left;"><span style="color: #888888;"><em># USB device 0&#215;0bda:0&#215;8187 (rtl8187)<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:15:</em><em>&#8230;&#8230;&#8230;</em><em>&#8220;, ATTR{dev_id}==&#8221;0&#215;0&#8243;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;wlan*&#8221;, NAME=&#8221;wlan0&#8243;</em></span></p>
<p>En este caso, la interfaz nueva es la que tiene la mac <em>00:1d:</em><span style="color: #888888;"><em>&#8230;&#8230;&#8230;</em></span>, es suficiente con borrar la línea correspondiente a la mac antigua y cambiar eth2 por eth0:</p>
<p style="text-align: left;"><span style="color: #888888;"><em># PCI device 0&#215;11ab:0&#215;4364 (sky2)<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:1d:</em></span><span style="color: #888888;"><em>&#8230;&#8230;&#8230;</em></span><span style="color: #888888;"><em>&#8220;, ATTR{dev_id}==&#8221;0&#215;0&#8243;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;eth*&#8221;, NAME=&#8221;eth0&#8243;</em></span></p>
<p style="text-align: left;"><span style="color: #888888;"><em># USB device 0&#215;0bda:0&#215;8187 (rtl8187)<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:15:</em><em>&#8230;&#8230;&#8230;</em></span><span style="color: #888888;"><em><span style="color: #888888;">&#8220;, </span>ATTR{dev_id}==&#8221;0&#215;0&#8243;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;wlan*&#8221;, NAME=&#8221;wlan0&#8243;</em></span></p>
<p style="text-align: left;">Luego de hacer el cambio, simplemente se reinicia el ordenador y listo.</p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/671/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DOSBox en Debian Lenny</title>
		<link>http://www.laestacionerrante.com/archives/615</link>
		<comments>http://www.laestacionerrante.com/archives/615#comments</comments>
		<pubDate>Fri, 18 Sep 2009 16:27:44 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[juegos]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=615</guid>
		<description><![CDATA[Después de un tiempo incierto sin escribir nada voy a retomar el blog hablando de DOSBox.
DOSBox es una emulación de DOS, útil cuando por alguba razón necesitamos correr algún programa escrito para MS-DOS y no tenemos más que linux para trabajar, o bien cuando por ejemplo queremos jugar a algún juego abandoware (que no se [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p>Después de un tiempo incierto sin escribir nada voy a retomar el blog hablando de DOSBox.</p>
<p>DOSBox es una emulación de DOS, útil cuando por alguba razón necesitamos correr algún programa escrito para MS-DOS y no tenemos más que linux para trabajar, o bien cuando por ejemplo queremos jugar a algún juego <em>abandoware</em> (que no se ejecute con <em>scummvm</em>).</p>
<p>Lo bueno es que es realmente sencillo.</p>
<p><strong>Instalación:</strong></p>
<p><span style="color: #800000;"><em># apt-get install dosbox</em></span></p>
<p><strong>¿Como usarlo?</strong></p>
<p>Primero lanzarlo:</p>
<p><span style="color: #800000;"><em>$ </em></span><em><span style="color: #800000;"><span style="color: #800000;">do</span>sbox</span></em></p>
<p>Para pasar el teclado a español:</p>
<p><em><span style="color: #800000;">Z:\&gt; keyb sp</span></em></p>
<p>Para montar una unidad C en tu directorio de usuario:</p>
<p><em><span style="color: #800000;">Z:\&gt; mount c /home/usuario/</span></em></p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/615/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Montaje de un Servidor Ciego con Debian Lenny (16.-Instalación de TorrentFlux-b4rt)</title>
		<link>http://www.laestacionerrante.com/archives/593</link>
		<comments>http://www.laestacionerrante.com/archives/593#comments</comments>
		<pubDate>Sun, 23 Aug 2009 16:40:34 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=593</guid>
		<description><![CDATA[Nos conectamos por SSH al servidor. Antes de nada instalamos otras utilidades necesarias:
#apt-get install bzip2
#apt-get install unzip
#apt-get install uudeview
#apt-get install cksfv (en los repositorios de debian lenny no está, tendremos que activar momentáneamente los repositorios de testing)

Una vez allí lo primero es situarnos en la carpeta home del usuario root, donde descargaremos el archivo comprimido [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p style="font-style: normal; text-align: justify;"><span style="font-size: small;"><span style="text-decoration: none;">Nos conectamos por SSH al servidor. Antes de nada instalamos otras utilidades necesarias:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#apt-get install bzip2</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#apt-get install unzip</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#apt-get install uudeview</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#apt-get install cksfv </span></span></em></span></span><span style="font-size: x-small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">(en los repositorios de debian lenny no está, tendremos que activar momentáneamente los repositorios de testing)</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="font-size: small;"><span style="text-decoration: none;">Una vez allí lo primero es situarnos en la carpeta </span></span><span style="font-size: small;"><em><span style="text-decoration: none;">home</span></em></span><span style="font-size: small;"><span style="text-decoration: none;"> del usuario </span></span><span style="font-size: small;"><em><span style="text-decoration: none;">root</span></em></span><span style="font-size: small;"><span style="text-decoration: none;">, donde descargaremos el archivo comprimido del programa, y con el que trabajaremos a partir de ahora:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#cd /root<br />
#wget </span></span></em></span></span><span style="color: #800000;"><em><a href="http://download2.berlios.de/tf-b4rt/torrentflux-b4rt_1.0-beta2.tar.bz2">http://download2.berlios.de/tf-b4rt/torrentflux-b4rt_1.0-beta2.tar.bz2</a></em></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;">Tras descargar el archivo, debería tardar poco, tenemos que descomprimirlo de la siguiente manera:</p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#bunzip2 torrentflux-b4rt_1.0-beta2.tar.bz2</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#tar xvf torrentflux-b4rt_1.0-beta2.tar</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">Ahora vamos a crear la carpeta de </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">torrentflux</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;"> y por eso tendremos que copiar allí todo lo que haya en la carpeta </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">html</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">:</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#mkdir /home/usuarioweb/www/torrentflux<br />
#cp-r html / * /home/usuarioweb/www/torrentflux<br />
</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">Le cambiamos el propietario a la carpeta asignándole <em>www-data</em> que es utilizado por el usuario de <em>Apache</em> (el servidor web) pueda acceder a los archivos utilizados por<em> TorrentFlux</em>.</p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#chown-R www-data:www-data /home/usuarioweb/www/torrentflux </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;">Ahora hay que abrir un navegador dirigirlo allí: http://la Ip del servidor o Pc/torrentflux<br />
y tendrías que ver algo como esto:</p>
<p style="text-align: center;"><img class="aligncenter" style="border: 0pt none;" src="http://www.kubuntu-es.org/files/kubuntu-es.org/u3122/instant__nea1_0.png" border="0" alt="" width="425" height="153" align="bottom" /></p>
<p style="text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">Pasaremos por varios </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">Continue</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;"> en donde elegiremos la base de datos (en nuestro caso MySQL) y comprobará el PHP5, hasta que llegamos al siguiente punto importante, donde elegiremos la ruta donde guardará los archivos, aunque esa ruta será relativa pues en esa carpeta creará una carpeta por cada usuario que use y descargue algo con torrentflux-b4rt, pero lo que si </span></span></span></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">es importante es que esa ruta tenga los permisos correctos</span></span></span></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">, es decir que </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">www-data</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;"> el usuario de </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">Apache2</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;"> pueda escribir en ella. Lo guardaremos en “</span></span></span></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">/media/Archivos</span></span></span></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">“, para no tener problemas de permisos le he pasado el comando chmod con la opción 777, como veis a continuación, luego he indicado la ruta en el script de instalación del programa como veis en la captura:</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">#chmod 777 /media/Archivos/</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: center;"><img class="aligncenter" style="border: 0pt none;" src="http://farm3.static.flickr.com/2391/1536894877_5e69083689.jpg" border="0" alt="" width="425" height="247" align="bottom" /></p>
<p style="text-align: justify;">Pasado este punto, comprobará, de nuevo tras varios <em>Continue</em>, que tenemos todos los ejecutables que necesita para aprovechar todas las funciones, correctamente instalados, como veis en la captura a mi solo me falta uno, VLC, que solo se usa para hacer <em>Streaming</em> a través de la red directamente desde el propio programa, pero yo no necesito esa opción y me parece excesivo instalar <em>VLC</em> así que no lo instalo. Pero si os parece una función necesaria solo tenéis que instalarlo antes de este paso y lo detectará automáticamente. Podéis verlo en la captura:</p>
<p style="text-align: center;"><a href="http://farm3.static.flickr.com/2335/1537760030_27c1b83d7b_o.png" target="_blank"><span style="color: #000080;"><img class="aligncenter" style="border: 1px solid black;" src="http://farm3.static.flickr.com/2335/1537760030_667a6c44b8.jpg" border="1" alt="" width="425" height="212" align="bottom" /></span></a></p>
<p style="text-align: justify;">Una vez superado este punto hemos llegado al punto final del <em>script</em> de instalación, donde como podéis ver en la captura, nos comenta un detalle importante, cuando nos salga por primera vez la ventana de login, el usuario y la contraseña que introduzcamos serán las que el programa guardará como las del usuario SuperAdmin, así que fijaros bien que escribís que luego necesitaréis esa clave y user.</p>
<p style="text-align: center;"><img class="aligncenter" style="border: 0pt none;" src="http://farm3.static.flickr.com/2322/1537760690_e6eae33cc1.jpg" border="0" alt="" width="425" height="247" align="bottom" /></p>
<p style="text-align: justify;">Tras este paso veremos la ventana de Login, como veis en la captura, el usuario y la contraseña que introduzcáis ahora serán las que se guardarán como las del usuario SuperAdmin, así que aseguraos bien que ponéis y recordadlo claro.</p>
<p style="text-align: center;"><img class="aligncenter" style="border: 0pt none;" src="http://farm3.static.flickr.com/2198/1536849306_228bfa589b_o.png" border="0" alt="" width="425" height="208" align="bottom" /></p>
<p style="text-align: justify;">
<p style="text-align: justify;">Una vez puestos <em>Username</em> y <em>Password</em>, veremos la pantalla de configuración de <em>Torrentflux-b4rt</em>, y podremos configurar todos los aspectos del programa. Aquí os dejo una del programa en acción para que veáis como es funcionando:</p>
<p style="text-align: center;"><a href="http://farm3.static.flickr.com/2196/1535981215_e7d8b2211c_o.png" target="_blank"><span style="color: #000080;"><img class="aligncenter" style="border: 1px solid black;" src="http://farm3.static.flickr.com/2196/1535981215_d7ad75a30f.jpg" border="1" alt="" width="425" height="215" align="bottom" /></span></a></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">Un consejo: es muy recomendable configurar bien los límites de subida y bajada de acuerdo a nuestra conexión. De lo contrario consumirá todo el ancho de banda de nuestro servidor pudiéndose dar el caso de que no se puedan ofrecer otros servicios tan básicos durante la ejecución de torrentflux tales como la compartición de archivos.</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="background: transparent none repeat scroll 0% 0%;">Hasta aquí. Seguramente habrán muchas más utilidades para un servidor, pero con estas a mí me basta. De todos modos siempre es bueno conocer otras cosas que en cualquier momento futuro puedan llegar a ser útiles.</span></span></span></span></p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/593/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Montaje de un Servidor Ciego con Debian Lenny (15.-Servidor DNS con Bind9)</title>
		<link>http://www.laestacionerrante.com/archives/588</link>
		<comments>http://www.laestacionerrante.com/archives/588#comments</comments>
		<pubDate>Sun, 23 Aug 2009 11:10:22 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=588</guid>
		<description><![CDATA[Vamos a agregar un servicio de DNS al servidor para que resuelva todos los nombres y direcciones IP que necesite desde la red de área local. Lo que ganamos con esto es simplemente tiempo. No es lo mismo acceder a un servidor DNS de nuestro proveedor de servicios de Internet ( ISP ) por nuestro [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Vamos a agregar un servicio de </span></span><em><span style="text-decoration: none;"><span>DNS</span></span></em><span style="text-decoration: none;"><span> al servidor para que resuelva todos los nombres y direcciones IP que necesite desde la red de área local. Lo que ganamos con esto es simplemente tiempo. No es lo mismo acceder a un servidor </span></span><em><span style="text-decoration: none;"><span>DNS</span></span></em><span style="text-decoration: none;"><span> de nuestro proveedor de servicios de Internet ( ISP ) por nuestro </span></span><em><span style="text-decoration: none;"><span>router</span></span></em><span style="text-decoration: none;"><span> que acceder a una maquina que está conectada a nuestra red interna donde la velocidad de conexión es mucho mayor que la que nos pueda ofrecer cualquier ADSL</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Para instalarlo accedemos a una Terminal, nos identificamos como súper usuario </span></span><em><span style="text-decoration: none;"><span>root</span></span></em><span style="text-decoration: none;"><span> con el comando su y procedemos a su instalación con:</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install bind9</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Ahora vamos a editar antes de nada el fichero </span></span><em><span style="text-decoration: none;"><span>resolv.conf</span></span></em></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/resolv.conf</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Veremos algo así:</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>nameserver 89.29.160.2 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>nameserver 192.168.0.1 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Lo modificamos dejándolo así:</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>search </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">ejemplo.no-ip.info</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> #dirección del servidor<br />
nameserver 127.0.0.1 #lo dejamos así<br />
nameserver </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">192.168.0.1</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> #ip del router o puerta de enlace</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Una vez modificado vamos ha hacer una copia de seguridad del archivo de configuración de bind9 </span></span><em><span style="text-decoration: none;"><span>named.conf.options</span></span></em></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#cp /etc/bind/named.conf.options /etc/bind/named.conf.optionsOLD</span></span></em></span></span></p>
<p>Ahora lo editamos con:</p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/bind/named.conf.options</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Veremos algo así:</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>options { </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>directory &#8220;/var/cache/bind&#8221;; </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// If there is a firewall between you and nameservers you want </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// to talk to, you may need to fix the firewall to allow multiple </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// ports to talk.  See http://www.kb.cert.org/vuls/id/800113 </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// If your ISP provided one or more IP addresses for stable </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// nameservers, you probably want to use them as forwarders. </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// Uncomment the following block, and insert the addresses replacing </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// the all-0&#8217;s placeholder. </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// forwarders { </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>//      0.0.0.0; </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// }; </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>auth-nxdomain no;    # conform to RFC1035 </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>listen-on-v6 { any; }; </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="font-style: normal;" align="justify"><span style="text-decoration: none;"><span>modificamos las lineas …</span></span></span></p>
<p><em><span>// forwarders {<br />
// 0.0.0.0;<br />
// };</span></em></p>
<p>y añadimos la linea …</p>
<p><em><span>query-source address * port 53;</span></em></p>
<p>introducimos nuestra<span> </span><em><span>IP</span></em><em><span> </span></em><em><span>localhost</span></em> y descomentamos las lineas quedándonos así :</p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>options { </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>directory &#8220;/var/cache/bind&#8221;; </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// If there is a firewall between you and nameservers you want </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// to talk to, you may need to fix the firewall to allow multiple </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// ports to talk.  See http://www.kb.cert.org/vuls/id/800113 </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">query-source address * port 53;</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> </span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// If your ISP provided one or more IP addresses for stable </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// nameservers, you probably want to use them as forwarders. </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// Uncomment the following block, and insert the addresses replacing </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>// the all-0&#8217;s placeholder. </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">forwarders { </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"><span style="background: #ffff00 none repeat scroll 0% 0%;"> <span style="font-size: x-small;"><em><span>127.0.0.1; </span></em></span></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"><span style="background: #ffff00 none repeat scroll 0% 0%;"> <span style="font-size: x-small;"><em><span>192.168.0.1; </span></em></span></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"><span style="background: #ffff00 none repeat scroll 0% 0%;"> <span style="font-size: x-small;"><em><span>};</span></em></span></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> </span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>auth-nxdomain no;    # conform to RFC1035 </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>listen-on-v6 { any; }; </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Ahora podríamos reiniciar solo los servicios de la RED y del DNS pero yo prefiero reiniciar para ver si todo arranca perfectamente y no tiene problemas con otros programas que tengamos instalados:</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#reboot</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Una vez reiniciada la maquina vamos a ver que tal funciona. Como podremos ver a continuación el acceso a nombres en Internet va a ser súper rápido una vez accedamos a el por primera vez ya que todos los nombres que resolvamos conforme vallamos navegando se irán guardando en una tabla cache localmente en nuestro servidor.</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Vamos a usar para esto el comando </span></span><em><span style="text-decoration: none;"><span>dig</span></span></em><span style="text-decoration: none;"><span>, probaremos con el dominio </span></span><em><span style="text-decoration: none;"><span>google.com</span></span></em></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#dig www.google.com</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; Query time: 26 msec </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; SERVER: 127.0.0.1#53(127.0.0.1) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; WHEN: Sat May  9 18:14:57 2009 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; MSG SIZE  rcvd: 244</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Si nos fijamos a tardado unos </span></span><em><span style="text-decoration: none;"><span>26 milisegundos</span></span></em><span style="text-decoration: none;"><span>, pero si repetimos veremos que es muchísimo mas rápido que la primera vez:</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#dig www.google.com</span></span></em></span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; Query time: 2 msec </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; SERVER: 127.0.0.1#53(127.0.0.1) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; WHEN: Sat May  9 18:16:54 2009 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>;; MSG SIZE  rcvd: 244</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="font-style: normal;" align="justify"><span style="text-decoration: none;"><span>2 milisegundos es lo que ha tardado la segunda vez. Como veis es una manera mas de agilizar nuestra navegación en Internet ya que siempre sera mas rápido nuestro cable de red local conectado a </span></span><em><span style="text-decoration: none;"><span>10/100 Mbps </span></span></em><span style="text-decoration: none;"><span>que no el ancho de banda que nos pueda ofrecer nuestro </span></span><em><span style="text-decoration: none;"><span>Router</span></span></em><span style="text-decoration: none;"><span>.</span></span></span></p>
<p align="justify">Si necesitamos ofrecer servicio de <em><span>DNS</span></em> a todos los ordenadores que quisieran usar nuestro servidor desde Internet tan solo tendríamos que abrir el <em><span>puerto 53</span></em> y <em><span>redireccionarlo</span></em> hacia la <em><span>IP</span></em> de nuestro servidor aunque esto es una cosa que no recomiendo ya que si se sirven de este servicio muchos ordenadores a la vez podríamos tener problemas. No hablo de nuestro servidor ya que el haría su trabajo sin problemas pero nuestro ancho de banda de la <em><span>ADSL</span></em><em> </em>es tan pequeño que incluso podríamos tener problemas a la hora de acceder a Internet.</p>
<p align="justify">Localmente es una solución ideal para entornos donde se conectan varios ordenadores a Internet desde una misma área local agilizando la traducción de nombres a ips.</p>
<p align="justify">Ahora ya tenemos nuestro propio <em><span>servidor DNS</span></em> listo para la trabajar. Seguidamente vamos a configurar todos nuestros ordenadores para que puedan hacer uso de él.</p>
<p align="justify">En la mayoría de los sistemas <em><span>Linux</span></em> incluyendo, podemos configurarlo en el fichero <em><span>resolv.conf</span></em> agregando la <em><span>IP</span></em><em><span> </span></em>de nuestro servidor en la linea <em><span>nameserver</span></em> y nuestro dominio en la linea search. Como ejemplo, en un ordenador de nuestra red privada:</p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/resolv.conf</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p align="justify">Dejándolo tal que así:</p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>search </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">ejemplo.no-ip.info</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> #dirección del servidor<br />
nameserver </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">192.168.0.XXX </span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#ip del servidor<br />
nameserver </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: transparent none repeat scroll 0% 0%;">192.168.0.1</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> #ip del router o puerta de enlace</span></span></em></span></span></p>
<p style="font-style: normal;" align="justify">]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/588/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Montaje de un Servidor Ciego con Debian Lenny (14.-Seguridad con Fail2ban)</title>
		<link>http://www.laestacionerrante.com/archives/578</link>
		<comments>http://www.laestacionerrante.com/archives/578#comments</comments>
		<pubDate>Sun, 23 Aug 2009 11:03:21 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=578</guid>
		<description><![CDATA[La aplicación que vamos a usar para protegernos se llama Fail2Ban y se va a encargar de hacer de guardián las 24 horas del día bloqueando a todo aquel que tenga un numero de intentos fallidos de login en alguno de nuestros servicios. Vamos con su instalación. Ejecutamos una Terminal y nos logeamos como súper [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p align="justify"><span>La aplicación que vamos a usar para protegernos se llama </span><em><span style="text-decoration: none;"><span>Fail2Ban</span></span></em><span> y se va a encargar de hacer de guardián las 24 horas del día bloqueando a todo aquel que tenga un numero de intentos fallidos de login en alguno de nuestros servicios. Vamos con su instalación.</span> Ejecutamos una Terminal y nos logeamos como súper usuario <em><span>root</span></em> con el comando <em><span>su</span></em>, a continuación lo instalamos con</p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install fail2ban</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Ahora vamos a renombrar el fichero de configuración </span></span><em><span style="text-decoration: none;"><span>jail.conf</span></span></em><span style="text-decoration: none;"><span> por </span></span><em><span style="text-decoration: none;"><span>jail.confOLD</span></span></em><span style="text-decoration: none;"><span> ya que este mismo nos puede servir como referencia</span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.confOLD</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p align="justify">Como podemos ver en el interior de el archivo <em><span>jail.confOLD</span></em>, ya hay varias opciones editadas por defecto y solo están a la espera de ser editadas para ser activadas. A continuación os voy a exponer cual es mi configuración para que os sirva como ejemplo.</p>
<p>Creamos un nuevo <em>jail.conf</em> para asignarle nuestras propias regla</p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/fail2ban/jail.conf</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p>Especificando un poco sobre el fichero de configuración:</p>
<p style="margin-left: 2.41cm;"><em>ignoreip</em><em> : IPs de nuestra área local que queremos que se haga la vista gorda en caso de equivocación.<br />
</em><em>bantime</em><em> : Tiempo que el usuario que fallo el logeo se quedara sin poder acceder al servicio especificado en segundos.<br />
</em><em>maxretry</em><em> : Numero de intentos de logeo.<br />
</em><em>backend</em><em> : Permite de un modo o otro la escritura de ficheros log.<br />
</em><em>destemail</em><em> : Dirección de correo donde nos enviara las alertas.<br />
</em><em>action</em><em> : Forma en que </em><em><em>iptables</em></em><em> aplica sus reglas.<br />
</em><em>mail-whois-lines</em><em> : Se especifica que queremos que nos envié al correo en caso de intrusión.</em></p>
<p style="margin-left: -0.03cm; font-style: normal;">Esas lineas explican la configuración básica de el fichero, a continuación vamos a ver un ejemplo de las celdas que creamos para cada servicio:</p>
<p style="margin-left: 2.41cm;"><em>[</em><em>ssh</em><em>] : Tomare ssh como ejemplo pero esta es una linea que da igual lo que pongamos, ya que no afecta a la configuración.<br />
</em><em>enable</em><em> : Podemos introducir true para activarlo y false para desactivarlo.<br />
</em><em>port</em><em> : Nombre del servicio relacionado con el puerto.<br />
</em><em>filter</em><em> : Nombre del archivo .conf ubicado en el subdirectorio /etc/fail2ban/filter.d, este va relacionado con algún filtro ya creado.<br />
</em><em>logpath</em><em> : Ruta donde se ubica el fichero log donde se almacena toda la información de el servicio en cuestión.<br />
</em><em>maxretry</em><em> : Numero de intentos fallidos, aquí podemos especificar un carácter diferente para cada celda que creemos.<br />
</em><em>findtime</em><em> : Si alguien prueba x intentos en este periodo de tiempo especificado en segundos se le considera ataque.</em></p>
<p align="justify">Yo voy a proteger a los servicios <em><span>SSH</span></em><em><span>, </span></em><em><span>FTP</span></em>, y al <em><span>WWW</span></em> que son los que ofrecen mi servidor hacia internet. A cada uno le voy a dar un retardo de 300 segundos que vienen a ser unos 5 minutos para que durante ese tiempo el usuario que quiera conectarse no le sea una molestia esta medida de seguridad. 5 minutos es suficiente para evitar el uso malintencionado de un ataque por fuerza bruta o también llamado diccionario de nombres.</p>
<p align="justify">Si nos fijamos en mi fichero de configuración veréis un ejemplo de como lo tengo yo montado</p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Fail2Ban configuration file. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># This file was composed for Debian systems from the original one </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#  provided now under /usr/share/doc/fail2ban/examples/jail.conf </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#  for additional examples. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># To avoid merges during upgrades DO NOT MODIFY THIS FILE </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># and rather provide your changes in /etc/fail2ban/jail.local </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Author: Yaroslav O. Halchenko &lt;&#x64;&#x65;&#x62;&#x69;&#x61;&#x6e;&#x40;&#x6f;&#x6e;&#x65;&#x72;&#x75;&#x73;&#x73;&#x69;&#x61;&#x6e;&#x2e;&#x63;om&gt; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># $Revision: 281 $ </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># The DEFAULT allows a global definition of the options. They can be override </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># in each jail afterwards. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[DEFAULT] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># &#8220;ignoreip&#8221; can be an IP address, a CIDR mask or a DNS host </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>ignoreip = 127.0.0.1 </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">192.168.0.0/24 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>bantime  = </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">300 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry =</span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"> 3</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> </span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># &#8220;backend&#8221; specifies the backend used to get files modification. Available </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># options are &#8220;gamin&#8221;, &#8220;polling&#8221; and &#8220;auto&#8221;. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># yoh: For some reason Debian shipped python-gamin didn&#8217;t work as expected </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#      This issue left ToDo, so polling is default backend for now </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>backend = polling </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Destination email address used solely for the interpolations in </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># jail.{conf,local} configuration files. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>destemail = root@localhost </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># ACTIONS </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Default banning action (e.g. iptables, iptables-new, </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># iptables-multiport, shorewall, etc) It is used to define </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># action_* variables. Can be overriden globally or per </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># section within jail.local file </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>banaction = iptables-multiport </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># email action. Since 0.8.1 upstream fail2ban uses sendmail </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># MTA for the mailing. Change mta configuration parameter to mail </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># if you want to revert to conventional &#8216;mail&#8217;. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>mta = sendmail</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Default protocol </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>protocol = tcp </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Action shortcuts. To be used to define action parameter </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># The simplest action to take: ban only </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># ban &amp; send an e-mail with whois report to the destemail. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>action_mw = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s]</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s] </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># ban &amp; send an e-mail with whois report and relevant log lines </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># to the destemail. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>%(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s] </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Choose default action.  To change, just override value of &#8216;action&#8217; with the </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># interpolation to the chosen action shortcut (e.g.  action_mw, action_mwl, etc) in jail.local </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># globally (section [DEFAULT]) or per specific section </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>action = %(action_)s</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># JAILS </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Next jails corresponds to the standard configuration in Fail2ban 0.6 which </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># was shipped in Debian. Enable any defined here jail by including </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># [SECTION_NAME] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># enabled = true </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># in /etc/fail2ban/jail.local. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Optionally you may override any other parameter (e.g. banaction, </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># action, port, logpath, etc) in that section within jail.local </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[ssh] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled = true </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port    = </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">XXX</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter  = sshd </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/auth.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">3 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Generic filter for pam. Has to be used with action which bans all ports </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># such as iptables-allports, shorewall </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[pam-generic] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># pam-generic filter can be customized to monitor specific subset of &#8216;tty&#8217;s </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter  = pam-generic </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># port actually must be irrelevant but lets leave it all for some possible uses </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port = all </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>banaction = iptables-allports </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = anyport </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/auth.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = 6 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[xinetd-fail] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled   = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter    = xinetd-fail </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port      = all </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>banaction = iptables-multiport-log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath   = /var/log/daemon.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry  = 2 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[ssh-ddos] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port    = ssh </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter  = sshd-ddos </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/auth.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = 6 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># HTTP servers </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[apache] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port    = http,https </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter  = apache-auth </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath = /var/log/apache*/*error.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">3 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># default action is now multiport, so apache-multiport jail was left </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># for compatibility with previous (&lt;0.7.6-2) releases</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[apache-multiport] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled   = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port      = http,https </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter    = apache-auth </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath   = /var/log/apache*/*error.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry  = 6 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[apache-noscript] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port    = http,https </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter  = apache-noscript </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath = /var/log/apache*/*error.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">3 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[apache-overflows] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port    = http,https </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter  = apache-overflows </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath = /var/log/apache*/*error.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = 2 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># FTP servers </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[vsftpd] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = ftp,ftp-data,ftps,ftps-data </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = vsftpd </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/vsftpd.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># or overwrite it in jails.local to be </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># logpath = /var/log/auth.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># if you want to rely on PAM failed login attempts </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># vsftpd&#8217;s failregex should match both of those formats </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = 6 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[proftpd] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = ftp,ftp-data,ftps,ftps-data , </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">XXX</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = proftpd </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/proftpd/proftpd.log</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = </span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">3 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[wuftpd] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = ftp,ftp-data,ftps,ftps-data </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = wuftpd </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/auth.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>maxretry = 6 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Mail servers </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[postfix] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = smtp,ssmtp </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = postfix </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/mail.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[couriersmtp] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = smtp,ssmtp </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = couriersmtp </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/mail.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Mail servers authenticators: might be used for smtp,ftp,imap servers, so </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># all relevant ports get banned </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[courierauth] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = courierlogin </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/mail.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[sasl] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = sasl </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/mail.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># DNS Servers </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># These jails block attacks against named (bind9). By default, logging is off </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># with bind9 installation. You will need something like this: </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># logging { </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#     channel security_file { </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#         file &#8220;/var/log/named/security.log&#8221; versions 3 size 30m; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#         severity dynamic; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#         print-time yes; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#     }; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#     category security { </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#         security_file; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#     }; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># } </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># in your named.conf to provide proper logging </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Word of Caution: </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Given filter can lead to DoS attack against your DNS server </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># since there is no way to assure that UDP packets come from the </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># real source IP </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[named-refused-udp] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = domain,953 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>protocol = udp </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = named-refused </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/named/security.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>[named-refused-tcp] </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="text-decoration: none;"> </span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>enabled  = false </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>port     = domain,953 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>protocol = tcp </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>filter   = named-refused </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>logpath  = /var/log/named/security.log </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">findtime = 600</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p align="justify"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Como podéis ver en la configuración anterior se especifican reglas para cada servicio especificando el puerto, filtro, ruta donde se ubica el fichero </span></span></span></span><span style="color: #000000;"><em><span style="text-decoration: none;"><span>log</span></span></em></span><span style="font-style: normal;"><span style="text-decoration: none;"><span> que genera el servicio y el máximo de intentos de logeo. </span></span></span></span>Una vez editado este fichero de configuración salimos y guardamos. A continuación ejecutamos nuestro guardián con:</p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#fail2ban-client start</span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Si todo va bien veremos algo así:</span></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>2009-05-13 19:15:49,367 fail2ban.server : INFO   Starting Fail2ban v0.8.3 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>2009-05-13 19:15:49,368 fail2ban.server : INFO   Starting in daemon mode </span></span></em></span></span></p>
<p style="margin-bottom: 0cm;" align="left">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="text-decoration: none;"><span>Si lo configuramos correctamente solo veremos esta linea, si no veremos alguna linea tipo </span></span><em><span style="text-decoration: none;"><span>Warning. ( ATENCIÓN</span></span></em><span style="text-decoration: none;"><span> : Ella siempre nos especifica el problema que tenemos en el fichero </span></span><em><span style="text-decoration: none;"><span>fail.conf</span></span></em><span style="text-decoration: none;"><span>).</span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal;" align="justify">
<p style="margin-bottom: 0cm; font-style: normal;" align="justify"><span style="font-size: small;"><span style="text-decoration: none;"><span>Si queréis ver que tal andamos de bloqueos podéis ver el fichero </span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span>fail2ban.log</span></span></em></span><span style="font-size: small;"><span style="text-decoration: none;"><span> que se ubica en la ruta </span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span>/var/log</span></span></em></span><span style="font-size: small;"><span style="text-decoration: none;"><span> donde se guardan todos los bloqueos, ips, fecha y hora de quien nos está atacando</span></span></span></span></p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/578/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Un Poco de Seguridad en las Transmisiones FTP: ProFTPD con TLS</title>
		<link>http://www.laestacionerrante.com/archives/566</link>
		<comments>http://www.laestacionerrante.com/archives/566#comments</comments>
		<pubDate>Tue, 11 Aug 2009 18:52:41 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=566</guid>
		<description><![CDATA[Suponiendo que tenemos instalado en nuestro servidor ProFTPD y OpenSSL, podemos configurar el servicio FTP para que trabaje con un poco más de seguridad. Las transmisiones a través de FTP son de por sí inseguras por que viajan en texto plano. Con TLS conseguiremos cifrar la información. Para activarlo debemos modificar el archivo de configuración [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p>Suponiendo que tenemos instalado en nuestro servidor ProFTPD y OpenSSL, podemos configurar el servicio FTP para que trabaje con un poco más de seguridad. Las transmisiones a través de FTP son de por sí inseguras por que viajan en texto plano. Con TLS conseguiremos cifrar la información. Para activarlo debemos modificar el archivo de configuración de ProFTPD:</p>
<p><em><span style="color: #800000;">#cd /etc/proftpd/</span></em></p>
<p><em><span style="color: #800000;">#nano proftpd.conf</span></em></p>
<p>Y añadir lo siguiente:</p>
<pre><span style="color: #003366;"># Includes DSO modules</span></pre>
<pre><span style="color: #003366;">Include /etc/proftpd/modules.conf</span></pre>
<p>Y&#8230;.</p>
<pre><span style="color: #003366;"># This is used for FTPS connections</span></pre>
<pre><span style="color: #003366;">Include /etc/proftpd/tls.conf</span></pre>
<p>Para poder trabajar con TLS debemos crear un certificado SSL. Para ello crearemos antes una carpeta para guardarlos:</p>
<p><em><span style="color: #800000;"># mkdir /etc/proftpd/ssl</span></em></p>
<p>Entonces generaremos el certificado:</p>
<p><em><span style="color: #800000;"># openssl req -new -x509 -days 365 -nodes -out /etc/proftpd/ssl/proftpd.cert.pem -keyout /etc/proftpd/ssl/proftpd.key.pem</span></em></p>
<p>Ahora abriremos el archivo de configuración de TLS:</p>
<p><em><span style="color: #800000;"># nano /etc/proftpd/tls.conf</span></em></p>
<p>Y añadimos lo siguiente:</p>
<pre><span style="color: #003366;">&lt;IfModule mod_tls.c&gt;
TLSEngine                  on
TLSLog                     /var/log/proftpd/tls.log
TLSProtocol                SSLv23
TLSOptions                 NoCertRequest
TLSRSACertificateFile      /etc/proftpd/ssl/proftpd.cert.pem
TLSRSACertificateKeyFile   /etc/proftpd/ssl/proftpd.key.pem
TLSVerifyClient            off
TLSRequired                on
&lt;/IfModule&gt;</span></pre>
<p>Ahora tan solo debemos reiniciar ProFTPD:</p>
<p><em><span style="color: #800000;"># /etc/init.d/proftpd restart</span></em></p>
<p>Cabe señalar que la opción <em><span style="color: #003366;">TLSRequired</span></em> especifica la exclusividad de usar en el cliente FTP con TLS. Si la tenemos activada, como es el caso no podremos conectarnos al servidor por medio del FTP clásico.</p>
<p>No todos los clientes FTP disponen de conexión vía TLS. Sin embargo Filezilla sí. Para instalarlo:</p>
<p><em><span style="color: #800000;"># apt-get install filezilla</span></em></p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/566/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mostrar el Uso de Espacio en Disco desde Consola</title>
		<link>http://www.laestacionerrante.com/archives/554</link>
		<comments>http://www.laestacionerrante.com/archives/554#comments</comments>
		<pubDate>Mon, 10 Aug 2009 07:49:37 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=554</guid>
		<description><![CDATA[El comando que nos muestra el uso de espacio de todas las particiones es “df“. Proporciona la cantidad de espacio usado en disco y la cantidad de espacio disponible. Para usarlo es sencillo, sólo escribimos en la consola df. Nos mostrará la información de todos los sistemas de archivos que se encuentren montados actualmente y [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p style="text-align: justify;">El comando que nos muestra el uso de espacio de todas las particiones es “<span style="color: #800000;"><em>df</em></span>“. Proporciona la cantidad de espacio usado en disco y la cantidad de espacio disponible. Para usarlo es sencillo, sólo escribimos en la consola df. Nos mostrará la información de todos los sistemas de archivos que se encuentren montados actualmente y nos arrojará la información en bloques de 1kb. Podemos hacer uso del parámetro “<em><span style="color: #800000;">-h</span></em>”. Éste lo que hará es que nos mostrará la información de manera más legible, es decir en Mb y Gb. Si sólo queremos saber la capacidad de una partición podemos hacer que se muestre sólo esa agregando su ruta después del -h, ésto sería algo así: <span style="color: #800000;"><em>df -h /media/disk</em></span>. Referencia <em><a href="http://huevas.wordpress.com/2007/08/10/ver-espacio-en-disco-duro-desde-la-consola/" target="_blank">http://huevas.wordpress.com/</a></em></p>
<p><span style="color: #800000;"><em># df -h<br />
S.ficheros          Tamaño   Usado     Disp    Uso% Montado en<br />
/dev/sda1              19G      903M      17G      6%       /<br />
tmpfs                     2,0G             0       2,0G      0%      /lib/init/rw<br />
udev                     10M          80K     10M       1%      /dev<br />
tmpfs                    2,0G              0      2,0G       0%      /dev/shm<br />
/dev/sda6            67G       200M      63G       1%      /home<br />
/dev/sda7          367G         30G    319G       9%      /mnt/datos.01<br />
/dev/sdb1         463G       344G       96G     79%      /mnt/datos.02</em></span></p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/554/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitorización de un SAI en Debian Lenny</title>
		<link>http://www.laestacionerrante.com/archives/537</link>
		<comments>http://www.laestacionerrante.com/archives/537#comments</comments>
		<pubDate>Mon, 10 Aug 2009 07:49:00 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=537</guid>
		<description><![CDATA[Fusilado de: http://www.eniac2000.com/?p=608
En líneas generales, un SAI (sistema de alimentación ininterrumpida) es un dispositivo que permite mantener la alimentación de dispositivos electrónicos (en este caso, un PC) cuando hay un corte en la corriente eléctrica, durante un período variable en función de las baterías con las que vaya equipado el SAI, pero que suele rondar [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p style="text-align: justify;">Fusilado de: <em><a href="http://www.eniac2000.com/?p=608" target="_blank">http://www.eniac2000.com/?p=608</a></em></p>
<p style="text-align: justify;">En líneas generales, un SAI (sistema de alimentación ininterrumpida) es un dispositivo que permite mantener la alimentación de dispositivos electrónicos (en este caso, un PC) cuando hay un corte en la corriente eléctrica, durante un período variable en función de las baterías con las que vaya equipado el SAI, pero que suele rondar el cuarto de hora-media hora, más que suficiente para que vuelva la luz o alguien vuelva a poner los plomos en su sitio. Además el SAI actua como estabilizador de corriente, protegiendo al PC de las variaciones en el suministro (lo que se suele conocer como <em>“la chispa adecuada”</em> -adecuada para achicharrarte el equipo-).</p>
<p style="text-align: justify;">Eso ya de por sí estaría bien, pero puestos a llevar la situación al extremo, podría suceder que el apagón tuviera una duración mayor del tiempo que el SAI es capaz de suministrar energía, o que no hubiera nadie para volver a dar los plomos. El corte indeseado de corriente se produciría igualmente, pero con una cierta demora. Sin embargo, los SAIs vienen equipados con un puerto de comunicación (generalmente serie o USB) que permite al ordenador saber cuándo la batería del SAI está llegando a un nivel crítico, y apagarse de manera automática. Pues bien, Linux está preparado para llevar a cabo este proceso, en concreto haciendo uso de NUT (<a href="http://www.networkupstools.org/">Network UPS Tools</a>).</p>
<p style="text-align: justify;">Para configurar la monitorización de un SAI en Debian el procedimiento a seguir sería el siguiente:</p>
<p style="text-align: justify;"><span style="text-decoration: underline;"><em><strong>Instalación de NUT</strong></em></span></p>
<p style="text-align: justify;">En Debian es tan simple como instalar NUT mediante apt-get:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em># apt-get install nut</em></span></p>
<p style="text-align: justify;"><span style="text-decoration: underline;"><em><strong>Instalación de paquetes auxiliares</strong></em></span></p>
<p style="text-align: justify;">Puede ser necesario realizar una instalación de paquetes auxilares. Estos paquetes son los siguientes:</p>
<ul style="text-align: justify;">
<li>nut-usb: Necesario si el SAI sólo tiene conexión USB (el Yukai dispone de puerto serie y USB; yo he elegido utilizar el puerto serie para tener un puerto USB más disponible)</li>
<li>nut-snmp: Necesario si se necesita un driver <a href="http://es.wikipedia.org/wiki/Simple_Network_Management_Protocol">SNMP</a> para monitorizar el SAI en red local</li>
<li>nut-cgi: Este paquete ofrece una interfaz web, programada en CGI, para monitorizar el SAI desde un navegador web</li>
<li>knutclient: Este paquete proporciona una aplicación cliente de KDE para monitorizar el SAI</li>
</ul>
<p style="text-align: justify;"><span style="text-decoration: underline;"><em><strong>Configuración de NUT</strong></em></span></p>
<p style="text-align: justify;">Una vez realizado el proceso de instalación mediante apt-get, es preciso realizar la configuración de NUT para que reconozca nuestro SAI. En primer lugar, es preciso editar el archivo <em>/etc/default/nut</em> para hacer que los demonios de NUT se inicien de manera automática. El contenido del archivo debe ser el siguiente:</p>
<p style="text-align: justify;"><em><span style="color: #800000;"># start upsd<br />
START_UPSD=yes</span></em></p>
<p style="text-align: justify;"><em><span style="color: #800000;"># start upsmon<br />
START_UPSMON=yes</span></em></p>
<p style="text-align: justify;"><em>U</em>na vez hecho esto, es preciso añadir el usuario <em>nut</em> al grupo <em>dialout </em>y<em> tty</em>, propietario de los puertos serie:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em># adduser nut dialout</em></span></p>
<p><span style="color: #800000;"><em># adduser nut tty<br />
</em></span></p>
<p style="text-align: justify;">A continuación hay que configurar el controlador de nut. Los archivos de configuración del controlador deben encontrarse en el directorio <em>/etc/nut</em>. Sin embargo, la instalación de apt-get crea el directorio, pero no incluye por defecto ningún archivo en el directorio, siendo preciso copiarlos desde el directorio <em>/usr/share/doc/nut/examples/</em>:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em># cp /usr/share/doc/nut/examples/*.conf.sample /etc/nut<br />
# cp /usr/share/doc/nut/examples/*.users.sample /etc/nut</em></span></p>
<p style="text-align: justify;">(Luego habrá que renombrarlos quitándole la terminación <em><span style="color: #800000;">*.sample</span></em>.)</p>
<p style="text-align: justify;">En primer lugar ha de editarse el archivo <em>/etc/nut/ups.conf</em>. Su contenido ha de ser el siguiente:</p>
<p style="text-align: justify;"><em><span style="color: #800000;">[</span></em><em><span style="color: #800000;">misai]<br />
driver = megatec_usb<br />
port = auto</span></em></p>
<p style="text-align: justify;"><em>L</em>a primera línea designa el nombre que vamos a dar a nuestro SAI. La segunda indica a NUT el <a href="http://www.networkupstools.org/compat/">driver</a> a usar para comunicarse con nuestro SAI, y la tercera indica qué puerto de comunicación a usar (en este caso, el primer puerto serie -COM1-).</p>
<p style="text-align: justify;">En segundo lugar ha de configurarse el archivo <em>/etc/nut/upsd.conf</em>, que indica las máquinas con permisos para acceder al demonio upsd. Un ejemplo de configuración sería el siguiente:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em>ACL localhost 127.0.0.1/32<br />
ACL local_network 192.168.0.0/24<br />
ACL all 0.0.0.0/0</em></span></p>
<p style="text-align: justify;"><span style="color: #800000;"><em>ACCEPT monitor localhost<br />
ACCEPT local_network<br />
REJECT all all</em></span></p>
<p style="text-align: justify;">Con esta configuración se está indicando que se permita el acceso al demonio al equipo local, así como a aquellos equipos que pertenezcan a la red local (siendo las direcciones de la red 192.168.0.xxx), y que rechace al resto de equipos.</p>
<p style="text-align: justify;">En tercer lugar se ha de indicar en el archivo <em>/etc/nut/upsd.users</em> qué usuarios tienen permisos para acceder al sistema de control de NUT, así como los permisos que tiene cada usuario. Un ejemplo de contenido sería el siguiente:</p>
<p style="text-align: justify;"><em><span style="color: #800000;">[admin]<br />
password    = passwordadmin<br />
allowfrom   = localhost local_network<br />
actions     = SET<br />
instcmds    = ALL</span></em></p>
<p style="text-align: justify;"><em><span style="color: #800000;">[control]<br />
password = passwordcontrol<br />
allowfrom = localhost local_network<br />
upsmon master</span></em></p>
<p style="text-align: justify;"><em><span style="color: #800000;">[clientes]<br />
password = passwordclientes<br />
allowfrom = local_network<br />
upsmon slave</span></em></p>
<p style="text-align: justify;">El código entre corchetes indica el nombre del usuario creado; la línea password especifica la contraseña del usuario, la línea allowfrom indica desde dónde (definido en el archivo <em>/etc/nut/upsd.conf</em>) se puede conectar ese usuario. La línea actions define las acciones que ese usuario puede realizar, la línea instcmds define los comandos que pueden ser usados por el usuario, por último, la línea upsmon master define que ese usuario será el controlador del servidor, y upsmon slave será el controlador remoto.</p>
<p style="text-align: justify;">Por último, se ha de configurar el archivo <em>/etc/nut/upsmon.conf</em>, que controla el acceso al monitor NUT del SAI. Un ejemplo de archivo sería el siguiente:</p>
<p style="text-align: justify;"><em><span style="color: #800000;">MONITOR misai@localhost 1 control passwordcontrol master<br />
RUN_AS_USER nut<br />
MINSUPPLIES 1<br />
SHUTDOWNCMD &#8220;/sbin/shutdown -h +0&#8243;<br />
POLLFREQ 5<br />
POLLFREQALERT 5<br />
HOSTSYNC 15<br />
DEADTIME 15<br />
POWERDOWNFLAG /etc/killpower</span></em></p>
<p style="text-align: justify;"><em><span style="color: #800000;">NOTIFYMSG ONLINE &#8220;UPS: Normal state&#8221;<br />
NOTIFYMSG ONBATT &#8220;UPS: Cable communication error&#8221;<br />
NOTIFYMSG LOWBATT &#8220;UPS: Battery low&#8221;<br />
NOTIFYMSG FSD &#8220;UPS: Starting shutdown&#8221;<br />
NOTIFYMSG COMMOK &#8220;UPS: Communication restored&#8221;<br />
NOTIFYMSG COMMBAD &#8220;UPS: Communication lose&#8221;<br />
NOTIFYMSG SHUTDOWN &#8220;UPS: Shutting down&#8221;<br />
NOTIFYMSG REPLBATT &#8220;UPS: Replace battery&#8221;<br />
NOTIFYFLAG ONLINE SYSLOG<br />
NOTIFYFLAG ONBATT SYSLOG+WALL<br />
NOTIFYFLAG LOWBATT SYSLOG+WALL<br />
NOTIFYFLAG FSD SYSLOG+WALL<br />
NOTIFYFLAG COMMOK SYSLOG<br />
NOTIFYFLAG COMMBAD SYSLOG<br />
NOTIFYFLAG SHUTDOWN SYSLOG<br />
NOTIFYFLAG REPLBATT SYSLOG</span></em></p>
<p style="text-align: justify;"><em><span style="color: #800000;">RBWARNTIME 43200<br />
NOCOMMWARNTIME 300<br />
FINALDELAY 5</span></em></p>
<p style="text-align: justify;">Nótese que en en este archivo la línea MONITOR especifica que queremos monitorizar el SAI llamado <em>misai,</em> conectado a la máquina localhost (localmente), que tiene 1 batería, el usuario es <em>control,</em> nuestro password es <em>passwordcontrol</em> y estamos en modo master. Por otro lado, el archivo permite configurar el comando de apagado, los mensajes de aviso del estado del SAI.</p>
<p style="text-align: justify;"><span style="color: #800000;"><em><span># chown root:nut /etc/nut/*<br />
</span></em></span></p>
<p><span style="color: #800000;"><em><span># chmod o-r /etc/nut/*</span></em></span></p>
<p style="text-align: justify;">Por último, se ha de iniciar el servidor mediante el siguiente comando:</p>
<p style="text-align: justify;"><em><span style="color: #800000;"># /etc/init.d/nut restart</span></em></p>
<p style="text-align: justify;">Se puede monitorizar el SAI desde línea de comandos:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em># upsc misai@localhost</em></span></p>
<p style="text-align: justify;">Monitorización remota mediante servicio web</p>
<p style="text-align: justify;">Una posibilidad bastante interesante que soporta NUT es la monitorización del SAI mediante servicio web. Para ello provee de un script CGI que permite acceder al estado del SAI haciendo uso de un navegador.</p>
<p style="text-align: justify;">En primer lugar, ha de instalarse el paquete <em>nut-cgi</em> mediante apt-get:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em># apt-get install nut-cgi</em></span></p>
<p style="text-align: justify;">Este comando instala el paquete, así como los scripts cgi en el directorio por defecto de instalación de ficheros cgi-bin de nuestro servidor web (con apache, <em>/usr/lib/cgi-bin</em>).</p>
<p style="text-align: justify;">En segundo lugar es preciso crear los archivos de configuración de <em>nut-cgi</em>. Como en el caso anterior, la instalación por defecto no copia estos archivos en el directorio de nut, por lo que es preciso copiarlos desde <em>/usr/share/doc/nut-cgi/examples/</em>:</p>
<p style="text-align: justify;"><em><span style="color: #800000;"># cp /usr/share/doc/nut-cgi/examples/*.* /etc/nut </span></em></p>
<p>(Luego habrá que renombrarlos quitándole la terminación <em><span style="color: #800000;">*.sample</span></em>.)</p>
<p style="text-align: justify;">Una vez hecho esto, se ha de editar el archivo <em>hosts.conf</em> para indicar a qué SAIs se quiere permitir el acceso desde el servicio web. Un ejemplo de contenido sería el siguiente:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em>MONITOR misai@localhost &#8220;Belkin Active Battery Backup&#8221;</em></span></p>
<p style="text-align: justify;">Por último, se ha de editar el archivo <em>/etc/nut/upsset.conf</em> para indicar desde qué equipos puede accederse al script cgi. Un ejemplo de contenido sería el siguiente:</p>
<p style="text-align: justify;"><em><span style="color: #800000;">&lt;Files upsset.cgi&gt;<br />
deny from all<br />
allow from 192.168.0.0<br />
&lt;/Files&gt;</span></em></p>
<p style="text-align: justify;"><em>D</em>e esta manera, estamos indicando que sólo puede accederse desde los equipos pertenecientes a la red local.</p>
<p style="text-align: justify;">Para acceder al scritp, hemos de entrar en la siguiente dirección desde nuestro navegador favorito:</p>
<p style="text-align: justify;"><span style="color: #800000;"><em>h</em><em>ttp://IP/cgi-bin/nut/upsstats.cgi</em></span></p>
<p style="text-align: justify;">Las pantallas de monitorización serían como las siguientes:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://bitacora.eniac2000.com/wp-content/nutcgi01.png" alt="Pantalla inicial de nut-cgi" width="480" height="96" /><br />
<strong><em>Pantalla inicial de nut-cgi</em></strong></p>
<p style="text-align: center;"><img class="aligncenter" src="http://bitacora.eniac2000.com/wp-content/nutcgi02.png" alt="MonitorizaciÃ³n del SAI" width="480" height="284" /><br />
<strong><em>Monitorización del SAI</em></strong></p>]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/537/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Montaje de un Servidor Ciego con Debian Lenny (13.-Servidor de Archivos NFS)</title>
		<link>http://www.laestacionerrante.com/archives/524</link>
		<comments>http://www.laestacionerrante.com/archives/524#comments</comments>
		<pubDate>Sun, 09 Aug 2009 11:06:56 +0000</pubDate>
		<dc:creator>el orador sobre el páramo</dc:creator>
				<category><![CDATA[cartas náuticas]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servidor]]></category>

		<guid isPermaLink="false">http://www.laestacionerrante.com/?p=524</guid>
		<description><![CDATA[Antes de nada aprenderemos a formatear y particionar un nuevo disco duro desde la consola en Debian. Esto nos será muy útil para poder añadirle discos duros a nuestro servidor cuando lo necesitemos, ya que no disponemos de monitor ni entorno gráfico para hacerlo como de costumbre.
Conectamos el disco duro a la placa base y [...]]]></description>
			<content:encoded><![CDATA[<div class="shortcode-show-avatar"><img alt='' src='http://www.gravatar.com/avatar/8b50cacf7fc36b8b703f2a495f05de63?s=50&amp;d=&amp;r=G' class='avatar avatar-50 photo' height='50' width='50' /></div>
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Antes de nada aprenderemos a formatear y particionar un nuevo disco duro desde la consola en Debian. Esto nos será muy útil para poder añadirle discos duros a nuestro servidor cuando lo necesitemos, ya que no disponemos de monitor ni entorno gráfico para hacerlo como de costumbre.</span></span></p>
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Conectamos el disco duro a la placa base y le suministramos alimentación (en mi caso voy a probar con un disco muy antiguo de </span></span><em><span style="text-decoration: none;"><span>8 Gb</span></span></em><span style="text-decoration: none;"><span> que resucité de un pc antiguo). Una vez hecho esto, iniciamos el servidor y desde un terminal nos logeamos como </span></span><em><span style="text-decoration: none;"><span>root</span></span></em><span style="text-decoration: none;"><span> y tecleamos:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#fdisk -l</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Veremos algo parecido a esto:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Disco /dev/hda: 80.0 GB, 80026361856 bytes </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>255 heads, 63 sectors/track, 9729 cylinders </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Units = cilindros of 16065 * 512 = 8225280 bytes </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Disk identifier: 0xe29f786e </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda1   *           1        9399    75497436   83  Linux </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda2            9400        9729     2650725    5  Extendida </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda5            9400        9729     2650693+  82  Linux swap / Solaris </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">Disco /dev/hdc: 8455 MB, 8455200768 bytes </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>255 heads, 63 sectors/track, 1027 cylinders </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Units = cilindros of 16065 * 512 = 8225280 bytes </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Disk identifier: 0&#215;753fd0ae </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Como podéis ver en la imagen el disco duro de 80 Gb es el que tiene ya las particiones echas, las tres ultimas lineas ofrecen información sobre el disco duro de </span></span><em><span style="text-decoration: none;"><span>8 Gb</span></span></em><span style="text-decoration: none;"><span>.</span></span></p>
<p style="text-align: justify;">Seguidamente vamos a editar el segundo disco llamando al dispositivo en cuestión. En mi caso <em><span>hdc:</span></em></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#fdisk /dev/hdc</span></span></em></span></span></p>
<p style="font-style: normal; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Veremos algo como:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>El número de cilindros para este disco está establecido en 1027. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>No hay nada malo en ello, pero es mayor que 1024, y en algunos casos </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>podría causar problemas con: </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>1) software que funciona en el inicio (p.ej. versiones antiguas de LILO) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>2) software de arranque o particionamiento de otros sistemas operativos </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>(p.ej. FDISK de DOS, FDISK de OS/2) </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Orden (m para obtener ayuda):</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Como podéis ver nos muestra un aviso así que no tenemos que hacerle demasiado caso ya que solo me sale en discos duros grandes y de momento no me a dado problemas.</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">Pulsamos la tecla <span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;">n</span></em></span></span> para crear una nueva partición.</p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Acción de la orden </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>e   Partición extendida </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>p   Partición primaria (1-4)</span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="text-decoration: none;"><span>Primero nos deja optar por si vamos a querer que nuestra partición sea primaria o extendida. En mi caso voy a usar este disco con una sola partición así que voy a elegir primaria pulsando la tecla </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;">p</span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Número de partición (1-4): </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="text-decoration: none;"><span>Para el numero de partición introducimos el </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;">1</span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Primer cilindro (1-1027, valor predeterminado 1):</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="text-decoration: none;"><span>Pulsamos la tecla </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;">Enter</span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> </span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Se está utilizando el valor predeterminado 1 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Último cilindro o +tamaño o +tamañoM o +tamañoK (1-1027, valor predeterminado 1027):</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="text-decoration: none;"><span>Pulsamos la tecla </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;">Enter</span></em></span></span><span style="text-decoration: none;"><span> y listo</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Orden (m para obtener ayuda):</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="text-decoration: none;"><span>Ahora guardamos los cambios y salimos del programa </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;">fdisk</span></em></span></span><span style="text-decoration: none;"><span> con la tecla </span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;">w</span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Llamando a ioctl() para volver a leer la tabla de particiones. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Se están sincronizando los discos.</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Una vez echo esto lo que aremos a continuación es darle formato para que sea compatible con nuestro Linux formateando la partición en </span></span><em><span style="text-decoration: none;"><span>ext3</span></span></em><span style="text-decoration: none;"><span> con el siguiente comando:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#mkfs.ext3 /dev/hdc1</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;">Veremos algo así:</p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>mke2fs 1.41.3 (12-Oct-2008) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Etiqueta del sistema de ficheros= </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Tipo de SO: Linux </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Tamaño del bloque=4096 (bitácora=2) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Tamaño del fragmento=4096 (bitácora=2) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>516096 nodos-i, 2062336 bloques </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>103116 bloques (5.00%) reservados para el superusuario </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Primer bloque de datos=0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Número máximo de bloques del sistema de ficheros=2113929216 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>63 bloque de grupos </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>32768 bloques por grupo, 32768 fragmentos por grupo </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>8192 nodos-i por grupo </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Respaldo del superbloque guardado en los bloques: </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Escribiendo las tablas de nodos-i: hecho </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Creating journal (32768 blocks): hecho </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Escribiendo superbloques y la información contable del sistema de ficheros: hecho</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;">Una vez completado el formateo veremos un mensaje informándonos sobre cuando se ejecutara una revisión del disco en busca de errores.</p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>Este sistema de ficheros se revisará automáticamente cada 28 montajes o </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>180 días, lo que suceda primero.  Utilice tune2fs -c o -i para cambiarlo.</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;"><span style="text-decoration: none;"><span>Ahora vamos a montar esta partición, en mi caso la voy a usar como almacén y necesitamos crear un directorio para montar dicha partición. Creamos</span></span> el directorio donde queremos que se monte nuestra nueva partición:</p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#mkdir /mnt/almacen</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Ahora vamos a introducir los datos de esta partición en el fichero </span></span><em><span style="text-decoration: none;"><span>fstab</span></span></em><span style="text-decoration: none;"><span> para que al arrancar el ordenador se monte automáticamente como una partición mas del sistema.</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/fstab</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Veremos algo así:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># /etc/fstab: static file system information. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>proc                           /proc             proc       defaults              0               0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda1                  /                    ext3      errors=remount-ro 0            1 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda5                 none              swap            sw                  0              0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Lo que vamos a introducir son los datos de nuestra partición especificando en que directorio queremos que nos la monte. En mi caso voy a usarla de almacén y la voy a montar dentro de la carpeta de montaje </span></span><em><span style="text-decoration: none;"><span>mnt</span></span></em><span style="text-decoration: none;"><span> con el nombre </span></span><em><span style="text-decoration: none;"><span>almacen</span></span></em><span style="text-decoration: none;"><span> como podéis ver a continuación:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># /etc/fstab: static file system information. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>proc                           /proc             proc       defaults              0               0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda1                  /                    ext3      errors=remount-ro 0            1 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda5                 none              swap            sw                  0              0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">/dev/hdc1            /mnt/almacen    ext3        noatime               0               1</span></span></span></em></span></span><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span> </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;"><span style="text-decoration: none;"><span>Ahora hacemos una prueba y cargamos todo el contenido del fichero</span></span><span style="color: #000000;"><em><span style="text-decoration: none;"><span> fstab</span></span></em></span><span style="text-decoration: none;"><span> con el comando:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#mount -a</span></span></em></span></span></p>
<p style="font-style: normal; text-align: justify;">
<p style="text-align: justify;"><span style="text-decoration: none;"><span>Desde ya tendríamos que tener la partición montada y lista para ser usada en </span></span><span style="color: #000000;"><em><span style="text-decoration: none;"><span>/mnt/almacen</span></span></em></span><span style="text-decoration: none;"><span>, vamos a ver si esta montada ejecutando el comando</span></span><span style="text-decoration: none;">:</span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#mount</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Veremos que está montada correctamente:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/hda1 on / type ext3 (rw,errors=remount-ro) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>proc on /proc type proc (rw,noexec,nosuid,nodev) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>procbususb on /proc/bus/usb type usbfs (rw) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>udev on /dev type tmpfs (rw,mode=0755) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">/dev/hdc1 on /mnt/almacen type ext3 (rw,noatime)</span></span></span></em></span></span></p>
<p style="font-style: normal; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Y una vez visto esto, vamos a ver cómo configurar un servidor NFS en Linux para poder compartir una partición en nuestra red local y montarlo como si de una unidad mas se tratase en un cliente remoto.</span></span></p>
<p style="text-align: justify;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Para comenzar vamos a abrir una terminal, nos identificaremos con nuestro súper usuario </span></span></span><em><span style="text-decoration: none;"><span>root</span></span></em><span style="font-style: normal;"><span style="text-decoration: none;"><span> e instalaremos los paquetes necesarios para la configuración de servidor de archivos </span></span></span><span style="font-style: normal;"><span style="text-decoration: none;"><span>NFS</span></span></span><span style="font-style: normal;"><span style="text-decoration: none;"><span>. </span></span></span><em><span style="font-style: normal;"><span style="text-decoration: none;"><span>Mas adelante configuraremos los clientes:</span></span></span></em></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install portmap</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #808080;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install nfs-common</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install nfs-kernel-server </span></span></em></span></span></p>
<p style="text-align: justify;">En la instalación de este ultimo veremos una pantalla como esta</p>
<p style="text-align: justify;"><a href="http://www.laestacionerrante.com/wp-content/uploads/2009/08/nfs.jpg"><img class="aligncenter size-medium wp-image-527" title="nfs" src="http://www.laestacionerrante.com/wp-content/uploads/2009/08/nfs-300x181.jpg" alt="nfs" width="300" height="181" /></a></p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Seleccionamos la opción </span></span><em><span style="text-decoration: none;"><span>Keep your currently-installed version</span></span></em><span style="text-decoration: none;"> </span><span style="text-decoration: none;"><span>y continuamos ejecutando el comando:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>#rpcinfo -p </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Nos mostrará un resultado como este:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>programa vers proto   puerto </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100000    2   tcp    111  portmapper </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100000    2   udp    111  portmapper </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100024    1   udp  39787  status </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100024    1   tcp  42048  status </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100003    2   udp   2049  nfs </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100003    3   udp   2049  nfs </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100003    4   udp   2049  nfs </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100021    1   udp  36153  nlockmgr </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100021    3   udp  36153  nlockmgr </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100021    4   udp  36153  nlockmgr </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100003    2   tcp   2049  nfs </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100003    3   tcp   2049  nfs </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100003    4   tcp   2049  nfs </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100021    1   tcp  51935  nlockmgr </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100021    3   tcp  51935  nlockmgr </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100021    4   tcp  51935  nlockmgr </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100005    1   udp  40975  mountd </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100005    1   tcp  47076  mountd </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100005    2   udp  40975  mountd </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100005    2   tcp  47076  mountd </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100005    3   udp  40975  mountd </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="text-decoration: none;"> <span style="font-size: x-small;"><em><span>100005    3   tcp  47076  mountd </span></em></span></span><span style="font-size: x-small;"><em> </em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Tenéis que tener los mismos servicios que yo, así que si no ves alguno de ellos revisa la instalación de los programas anteriores.</span></span></p>
<p style="text-align: justify;">Ahora necesitamos saber la ruta donde se encuentra la partición o directorio que queremos compartir con las maquinas conectadas a nuestra red. En mi caso voy a compartir un disco duro completo que usare como almacén de datos (el de 8 Gb), esté lo tengo montado en la ruta <em><span>/mnt/almacen</span></em> del servidor.</p>
<p style="text-align: justify;">Para configurar la compartición de forma que todos los archivos que se creen en el servidor sean de un mismo propietario y grupo, sea cual sea el terminal desde el que se acceda, vamos a crear un propietario nuevo llamado <em>nfs</em>. Lo crearemos sin directorio <em>home</em> puesto que no vamos a darle uso como un usuario normal sino tan solo como propietario de los archivos compartidos de la red local.</p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#adduser &#8211;no-create-home nfs</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;">Y modificamos los números <em>UID</em> y <em>GID</em> asignados por defecto en los archivos <em>passwd</em> y <em>group, </em><span style="font-style: normal;">cambiándolos </span>por <em>1111</em> y <em>1111</em>, respectivamente. Esto lo hacemos para evitar que los números <em>UID</em> y <em>GID</em> del usuario <em>nfs</em> creado en el servidor coincida con los números <em>UID</em> y <em>GID</em> de otro usuario creado en otro teminal de la red y por tanto, los archivos creados desde allí aparezcan con el propietario del terminal (aunque sólo aparecerían en el propio terminal ya que si los viésemos desde el servidor aparecerían como propietario <em>nfs</em>).</p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/passwd</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/group,</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;">Una vez hecho esto necesitamos editar el archivo <em><span>exports</span></em> para indicarle que particiones o directorios queremos compartir.</p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/exports</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Añadiremos lo siguiente:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># /etc/exports: the access control list for filesystems which may be exported </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#               to NFS clients.  See unfsd(8). </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">/mnt/almacen    192.168.0.*(rw,sync,all_squash,anonuid=1111,anongid=1111)</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>donde </span></span><em><span style="text-decoration: none;"><span>/mnt/almacen</span></span></em><span style="text-decoration: none;"><span> es la ruta de montaje, </span></span><em><span style="text-decoration: none;"><span>192.168.0.*</span></span></em><span style="text-decoration: none;"><span>es la ip broadcast acabada en asterisco, y </span></span><em><span style="text-decoration: none;"><span>(rw,sync,all_squash,anonuid=1111,anongid_1111)</span></span></em><span style="text-decoration: none;"><span> son las carácetrísticas que podemos darle al disco:</span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><em><span style="text-decoration: underline;"><span>rw</span></span></em><em><span style="text-decoration: none;"><span>: permiten exportar el recurso para escritura y lectura.</span></span></em></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><em><span style="text-decoration: underline;"><span>sync</span></span></em><em><span style="text-decoration: none;"><span>:ndica que se realicen las operaciones de escritura en el disco instantáneamente. Permite una mayor tolerancia ante una falla del sistema que pudiera provocar inconsistencias en el file system, pero empeora el desenvolvimiento. Por defecto es </span></span></em><tt><em><span style="text-decoration: none;"><span>async</span></span></em></tt><em><span style="text-decoration: none;"><span> (la opuesta de </span></span></em><tt><em><span style="text-decoration: none;"><span>sync</span></span></em></tt><em><span style="text-decoration: none;"><span>).</span></span></em></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><em><span style="text-decoration: underline;"><span>all_squash</span></span></em><em><span style="text-decoration: none;"><span>:habilita el squashing para todos los usuarios, o sea todos los identificadores en el cliente se mapean al identificador del usuario nobody en el servidor.</span></span></em></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><em><span style="text-decoration: underline;"><span>anonuid y anongid</span></span></em><em><span style="text-decoration: none;"><span>:indican que al hacer squash no se traduzcan los identificadores de grupo y usuario a los de nobody sino a los del usuario y grupo indicados mediante estas opciones.</span></span></em></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Si quisiéramos podríamos compartir X directorio con maquinas especificas y con permisos diferentes dependiendo de nuestras necesidades. Yo como quiero compartir esta unidad con toda mi red he optado por dar permisos de lectura y escritura para toda la red y no para una maquina especifica.</span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Damos permisos para que todos puedan leer y escribir en la unidad:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#chmod -R 777 /mnt/almacen</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Seguidamente reiniciamos el servidor </span></span><em><span style="text-decoration: none;"><span>NFS</span></span></em><span style="text-decoration: none;"><span> para que coja los cambios que acabamos de hacer con:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#/etc/init.d/nfs-kernel-server restart</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Ahora vamos a configurar el ordenador cliente. Existen dos formas:</span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: underline;"><span>1.-Mediante el archivo </span></span><em><span style="text-decoration: underline;"><span>fstab</span></span></em></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Para ello instalamos:</span></span></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install nfs-common</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Luego creamos la carpeta donde se montará el disco:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#mkdir /mnt/servidor_almacen</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Para que cuando arranque el solito nos conecte a nuestra unidad de red automáticamente vamos a configurar el fichero de montaje de unidades </span></span><em><span style="text-decoration: none;"><span>fstab</span></span></em><span style="text-decoration: none;"><span> y agregaremos nuestro nuevo dispositivo:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/fstab</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Añadimos:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># /etc/fstab: static file system information. </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt; </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>proc            /proc           proc    defaults        0       0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/sda1       /               ext3    errors=remount-ro 0       1 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/sda6       /home           ext3    defaults        0       2 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/sdb1       /media/datos01  ext3    defaults        0       2 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/sda5       none            swap    sw              0       0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">192.168.0.XXX:/mnt/almacen /mnt/servidor_almacen nfs rw,hard,intr,user,defaults 0 0 </span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Si nos fijamos en el ejemplo he agregado en la ultima linea la dirección ip de mi servidor, el directorio de montaje y la ruta donde quiero que se monte la unidad compartida.</span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: underline;"><span>2.-Mediante </span></span><em><span style="text-decoration: underline;"><span>autofs</span></span></em></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Para ello tendremos que instalar:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install nfs-common</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#apt-get install autofs</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Esta otra forma de montaje en mi opinión es mejor. Lo que vamos a hacer es no montar desde el arranque el disco compartido, si no que sólo lo montaremos cuando accedamos a él. Mientras permanecerá sin montar. ¿Qué ventajas tiene esto? Bueno, para empezar que si no tenemos en un determinado momento el servidor encendido no pasará nada. En cambio con </span></span><em><span style="text-decoration: none;"><span>fstab</span></span></em><span style="text-decoration: none;"><span> intentará montar el disco (aunque con la opción </span></span><em><span style="text-decoration: none;"><span>soff</span></span></em><span style="text-decoration: none;"><span> en lugar de </span></span><em><span style="text-decoration: none;"><span>hard</span></span></em><span style="text-decoration: none;"><span> evitamos en cierto modo esto). Otra ventaja es que cuando son muchos clientes ahorramos recursos.</span></span></p>
<p style="font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="text-decoration: none;"><span>Autofs consulta el mapa maestro del archivo de configuración </span></span><span style="color: #000000;"><em><span style="text-decoration: none;"><span>/etc/auto.master</span></span></em></span><span style="text-decoration: none;"><span> para ver qué puntos de montaje se han definido. Luego arranca un proceso automount con los parámetros adecuados para cada punto de montaje. Cada línea del mapa maestro define un punto de montaje y un archivo de mapa separado que define el sistema de archivos que se tiene que montar en este punto de montaje. Vamos a añadir un punto de montaje al archivo auto.master</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/auto.master</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Agregamos la línea dejándolo tal que así.</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $ </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># Sample auto.master file </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># This is an automounter map and it has the following format </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># key [ -mount-options-separated-by-comma ] location </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span># For details of the format look at autofs(5). </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#/misc  /etc/auto.misc &#8211;timeout=60 </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#/smb   /etc/auto.smb </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#/misc  /etc/auto.misc </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#/net   /etc/auto.net </span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span><span style="background: #ffff00 none repeat scroll 0% 0%;">/servidor   /etc/auto.servidor &#8211;timeout=60</span></span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>La estructura es </span></span><em><span style="text-decoration: none;"><span>&lt;Punto de Montaje&gt; &lt;Ruta archivo auto.montaje&gt;</span></span></em><span style="text-decoration: none;"><span> y una tercera opción </span></span><em><span style="text-decoration: none;"><span>&lt;&#8211;timeout=xx&gt;</span></span></em><span style="text-decoration: none;"><span> para indicar tiempo de desmontaje desde que entramos por última vez.</span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Ahora vamos a crear el archivo </span></span><em><span style="text-decoration: none;"><span>auto.servidor</span></span></em><span style="text-decoration: none;"><span> y en él especificaremos la carpeta de montaje, las opciones para definir el montaje y la ruta con la ip del servidor del disco a montar. Pondremos algo tal que así:</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>almacen -rw,soft,intr,rsize=8192,wsize=8192 192.168.0.XXX:/mnt/almacen</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Como podemos ver </span></span><em><span style="text-decoration: none;"><span>&lt;almacen&gt;</span></span></em><span style="text-decoration: none;"><span> será el nombre de la carpeta donde se nos montará el disco. Luego vemos las opciones precedidas de un &#8211; </span></span><em><span style="text-decoration: none;"><span>&lt;–opciones&gt;</span></span></em><span style="text-decoration: none;"><span> y por último </span></span><em><span style="text-decoration: none;"><span>&lt;ipdelservidor:rutacompartir&gt;</span></span></em><span style="text-decoration: none;"><span>.</span></span></p>
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;">
<p style="margin-bottom: 0cm; font-style: normal; text-align: justify;"><span style="text-decoration: none;"><span>Ahora, podemos crear un accedo directo en cualquier parte para que se nos muestre la carpeta.</span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#ln -s /servidor/almacen /mnt/servidor_almacen</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>También compartiremos por ejemplo el directorio que antes creamos para el servicio FTP. Para ello, abrimos como root el archivo exports</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#nano /etc/exports</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Yagregamos la línea:</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>ftp -rw,soft,intr,rsize=8192,wsize=8192 192.168.0.XXX:/home/ftp</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Ahora le cramos un acceso directo:</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="color: #800000;"><span style="font-size: x-small;"><em><span style="text-decoration: none;"><span>#ln -s /servidor/ftp /mnt/servidor_ftp</span></span></em></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>De este modo podremos gestionar los archivos del servidor FTP a través de un gestor de archivos desde cualquier terminal de la red.</span></span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: underline;">CURIOSIDADES</span></span></span></p>
<p style="margin-bottom: 0cm; text-align: justify;"><a href="http://miguelcarmona.name/blog/windows-como-cliente-nfs" target="_blank"><span style="font-size: small;"><em><span style="text-decoration: none;"><span>http://miguelcarmona.name/blog/windows-como-cliente-nfs</span></span></em></span></a></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="margin-bottom: 0cm; text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Si tenemos algún </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span>PC</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span> con </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span>windows</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>, existe una forma sencilla de acceder a nuestro servidor linux sin tener que instalar y configurar </span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span>Samba</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span> (que sería más idóneo que </span></span></span></span><span style="color: #000000;"><span style="font-size: small;"><em><span style="text-decoration: none;"><span>NFS</span></span></em></span></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span> para estos casos).</span></span></span></span></p>
<p style="text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Descargamos el software Servicios de Windows para UNIX 3.5 desde</span></span></span></span><span style="color: #000000;"><span style="font-size: small;"><span style="font-style: normal;"><span> </span></span></span></span><span style="color: #000000;"><span style="font-size: small;"><em><span><a href="http://www.microsoft.com/downloads/details.aspx?familyid=896C9688-601B-44F1-81A4-02878FF11778&amp;displaylang=en" target="_blank">http://www.microsoft.com/downloads/details.aspx?</a><a href="http://www.microsoft.com/downloads/details.aspx?familyid=896C9688-601B-44F1-81A4-02878FF11778&amp;displaylang=en" target="_blank">familyid=896C9688-601B-44F1-81A4-02878FF11778&amp;displaylang=en</a></span></em></span></span></p>
<p style="text-align: justify;">Si tenemos Windows Xp Home, el software no funcionará para esta versión. En esta dirección <a href="http://oreilly.com/pub/h/2883" target="_blank">http://oreilly.com/pub/h/2883</a> explican como corregirlo.</p>
<p style="text-align: justify;">Extraemos los archivos (en una ruta que recordemos, por ejemplo c:\UNIX_services).</p>
<p style="text-align: justify;">Lanzamos el asistente de instalación, aceptamos la licencia y 	elejimos &#8220;Custom Instalation&#8221;</p>
<p><img class="aligncenter" style="border: 0pt none;" src="http://miguelcarmona.name/media/image/post-blog/images/windows-como-cliente-nfs/windows_services_nfs_1.jpg" border="0" alt="" width="488" height="353" align="middle" /></p>
<p style="margin-bottom: 0cm; text-align: justify;">
<p style="text-align: justify;"><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>Desactivamos todas las entradas excepto &#8220;</span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span>Client for NFS</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>&#8221; y &#8220;</span></span></span></span><span style="font-size: small;"><em><span style="text-decoration: none;"><span>Authentication tools for NFS</span></span></em></span><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;"><span>&#8220;</span></span></span></span></p>
<p style="text-align: justify;">
<p style="text-align: center;"><img class="aligncenter" style="border: 0pt none;" src="http://miguelcarmona.name/media/image/post-blog/images/windows-como-cliente-nfs/windows_services_nfs_2.jpg" border="0" alt="" width="485" height="350" align="bottom" /></p>
<p style="text-align: justify;">Continuamos, finalizamos y reiniciamos el equipo</p>
<p style="text-align: justify;">En cualquier explorador de <em>windows</em>, elejimos <em>Herramientas -&gt; Conectar a unidad de red</em>. Elejimos letra de unidad y en carpeta, introducimos los datos de acceso con la siguiente estructura:</p>
<p style="text-align: justify;">servidor:/ruta_al/recurso_compartido/</p>
<p style="text-align: center;"><img class="aligncenter" style="border: 0pt none;" src="http://miguelcarmona.name/media/image/post-blog/images/windows-como-cliente-nfs/windows_services_nfs_5.jpg" border="0" alt="" width="443" height="336" align="bottom" /></p>
<p style="text-align: justify;">Finalizamos y nos saldrá una confirmación con el usuario por el cual se está conectando al servidor nfs. Podemos también <em>Examinar </em>y seleccionar los recursos compartidos.</p>
<p style="margin-bottom: 0cm;" align="justify">]]></content:encoded>
			<wfw:commentRss>http://www.laestacionerrante.com/archives/524/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
