tag:blogger.com,1999:blog-52820378601577318862024-03-13T08:42:34.305+01:00EiTheL InsideBlog dedicado a las experiencias en la implantación de software libre.Unknownnoreply@blogger.comBlogger287125tag:blogger.com,1999:blog-5282037860157731886.post-29281242868709415992022-08-30T10:07:00.000+02:002022-08-30T10:07:21.847+02:00Generador de ErrorDocument para Apache2<p><span style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; font-size: 14px;"></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEim4HS6Kt6yM67j7dMxdA-y3ktXLsowyZaX4dHzALoiyxkwwSOC10T9M-mGiVuvCpPOtvBYQyRUS-ptsd_dUQ379JPt9C8Jub5o-CBLaR25AsmfPtlKsTFcg2G2UDz58M4ImqlIok5jD8vPxk76xPq1l2uVM1mJwSF6AFRGinzbUfxFVUWNEOeDCwmo" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="" data-original-height="189" data-original-width="533" height="113" src="https://blogger.googleusercontent.com/img/a/AVvXsEim4HS6Kt6yM67j7dMxdA-y3ktXLsowyZaX4dHzALoiyxkwwSOC10T9M-mGiVuvCpPOtvBYQyRUS-ptsd_dUQ379JPt9C8Jub5o-CBLaR25AsmfPtlKsTFcg2G2UDz58M4ImqlIok5jD8vPxk76xPq1l2uVM1mJwSF6AFRGinzbUfxFVUWNEOeDCwmo" width="320" /></a></div><p></p><p><span style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">Apache ofrece la posibilidad de que los webmasters puedan configurar las respuestas que muestra el servidor Apache cuando se producen algunos errores o problemas.</span></p><p style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.3em;">Las respuestas personalizadas pueden definirse para activarse en caso de que el servidor detecte un error o problema.</p><p style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.3em;">Si un script termina de forma anormal y se produce una respuesta "500 Server Error", esta respuesta puede ser sustituida por otro texto de su elección o por una redirección a otra URL (local o externa).</p><p style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; line-height: 1.3em;"><span style="font-size: xx-small;">(Fuente <a href="https://httpd.apache.org/docs/2.2/es/custom-error.html">Apache.org</a>)</span></p><p style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.3em;">Así pues, podemos generar dentro del archivo /etc/apache2/apache2.conf unas líneas que nos permitan personalizar ese mensaje de error. Ahora bien, si lo que deseamos es controlar todos los mensajes de error y que todos vayan a una misma URL, podemos hacerlo mediante este fácil script que he creado:</p><p style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.3em;"><br /></p><blockquote><p style="background-color: white; line-height: 1.3em;"><span style="color: #003366; font-family: courier;"><span style="font-size: 14px;">#!/bin/bash</span></span></p><p style="background-color: white; line-height: 1.3em;"><span style="color: #003366; font-size: 14px;"><span style="font-family: courier;">text="https://MiDireccionURLoTEXTO/"</span></span></p><p style="background-color: white; line-height: 1.3em;"><span style="color: #003366; font-size: 14px;"><span style="font-family: courier;">for i in 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 422 423 424 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511</span></span></p><p style="background-color: white; line-height: 1.3em;"><span style="color: #003366; font-family: courier;"><span style="font-size: 14px;">do</span></span></p><p style="background-color: white; line-height: 1.3em;"><span style="color: #003366; font-family: courier;"><span style="font-size: 14px;"> echo ErrorDocument $i $text</span></span></p><p style="background-color: white; line-height: 1.3em;"><span style="color: #003366; font-family: courier;"><span style="font-size: 14px;">done</span></span></p><div><br /></div></blockquote><p style="background-color: white; color: #003366; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.3em;"><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-77408435969184461862022-04-29T13:12:00.002+02:002022-04-29T13:12:32.087+02:00Instalar Ubuntu en Windows 11<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW0KaxdkxHAW-gi11rDDJJXBoXK5S_qZZUbOCpX-819wDMW5kiclvSeqkGOtARClD1HFuexM5ICtGXKZfAH7JOTWW8TqkteQp-w56iLVqVdw7n7roUHZ8u8BYfKL8oHNj1qAl8eBd1jWoWZ4VFIl7_UdVOvFRIhoglXR8uWdncMLqf9ndz2OEeRqYu/s539/wsl-microsoft.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="303" data-original-width="539" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW0KaxdkxHAW-gi11rDDJJXBoXK5S_qZZUbOCpX-819wDMW5kiclvSeqkGOtARClD1HFuexM5ICtGXKZfAH7JOTWW8TqkteQp-w56iLVqVdw7n7roUHZ8u8BYfKL8oHNj1qAl8eBd1jWoWZ4VFIl7_UdVOvFRIhoglXR8uWdncMLqf9ndz2OEeRqYu/s320/wsl-microsoft.png" width="320" /></a></div><br /><p></p><p style="background-color: white; color: #202122; font-family: sans-serif; font-size: 14px; margin: 0.5em 0px;"><b>Windows Subsystem for Linux</b> (<b>WSL</b>) es una <a href="https://es.wikipedia.org/wiki/Capa_de_compatibilidad" style="background: none; color: #0645ad; text-decoration-line: none;" title="Capa de compatibilidad">capa de compatibilidad</a> desarrollada por <a href="https://es.wikipedia.org/wiki/Microsoft" style="background: none; color: #0645ad; text-decoration-line: none;" title="">Microsoft</a> para correr ejecutables de <a href="https://es.wikipedia.org/wiki/GNU/Linux" style="background: none; color: #0645ad; text-decoration-line: none;" title="GNU/Linux">Linux</a> (en formato <a href="https://es.wikipedia.org/wiki/Executable_and_Linkable_Format" style="background: none; color: #0645ad; text-decoration-line: none;" title="Executable and Linkable Format">ELF</a>) nativamente en <a href="https://es.wikipedia.org/wiki/Windows_10" style="background: none; color: #0645ad; text-decoration-line: none;" title="Windows 10">Windows 10</a> y <a href="https://es.wikipedia.org/wiki/Windows_Server_2019" style="background: none; color: #0645ad; text-decoration-line: none;" title="Windows Server 2019">Windows Server 2019</a>.</p><p style="background-color: white; color: #202122; font-family: sans-serif; font-size: 14px; margin: 0.5em 0px;">A partir de junio de 2019 está disponible <b>WSL versión 2</b>, el cual incorpora cambios importantes, como el uso de un <a href="https://es.wikipedia.org/wiki/N%C3%BAcleo_Linux" style="background: none; color: #0645ad; text-decoration-line: none;" title="Núcleo Linux">núcleo Linux</a> real.<sup class="reference separada" id="cite_ref-:0_4-0" style="line-height: 1em; margin-right: 0.6ch; unicode-bidi: isolate; white-space: nowrap;"><a href="https://es.wikipedia.org/wiki/Windows_Subsystem_for_Linux#cite_note-:0-4" style="background: none; color: #0645ad; text-decoration-line: none;">4</a></sup></p><p>(Fuente <a href="https://es.wikipedia.org/wiki/Windows_Subsystem_for_Linux">Wikipedia</a>)</p><p>Para instalarlo lo primero que tenemos que hacer es ir a nuestro Microsoft Store, buscar Ubuntu e instalarlo.</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEja7fQkabl_r5zRxCPBtXpr5EopFxu6_oESaaC2xF6T0yy2tr1_J7v2UZf_WhvdTLtbvGpmNx06TyPJebdH1nWerQm90OBCDUmd9rO5STkJ87XSc-l7Un92QjOeyzB1ooG22A8q3d9P3GFAFcnI7Kt5NLkq9jP9duMFIslFu3k-r0ElGmo8k2vpUIoe" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="311" data-original-width="860" height="232" src="https://blogger.googleusercontent.com/img/a/AVvXsEja7fQkabl_r5zRxCPBtXpr5EopFxu6_oESaaC2xF6T0yy2tr1_J7v2UZf_WhvdTLtbvGpmNx06TyPJebdH1nWerQm90OBCDUmd9rO5STkJ87XSc-l7Un92QjOeyzB1ooG22A8q3d9P3GFAFcnI7Kt5NLkq9jP9duMFIslFu3k-r0ElGmo8k2vpUIoe=w640-h232" width="640" /></a></div><p>Cuando lo ejecutemos nos dirá el siguiente mensaje:</p><p></p><p></p><blockquote>Installing, this may take a few minutes...<br />WslRegisterDistribution failed with error: 0x8007019e<br />The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again.<br />See https://aka.ms/wslinstall for details.<br />Press any key to continue...</blockquote><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhhLlIWUzCLkuGii27pHm_qe-3yWqEA2KVgzQGVXaqNpaIn4oPE88-PTDmEYlOgIYNGGW5jPtZu8myjRzwprj-zq0DbCOrIrgTcu-nuZRQcFjPgNjhCP_Ski86rddpkLbpTWGZiiFFGYO5bNiPcXKIATJHDwdpR-ernEilvGK2phrje5RTV7MnQw5ig" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="201" data-original-width="979" height="133" src="https://blogger.googleusercontent.com/img/a/AVvXsEhhLlIWUzCLkuGii27pHm_qe-3yWqEA2KVgzQGVXaqNpaIn4oPE88-PTDmEYlOgIYNGGW5jPtZu8myjRzwprj-zq0DbCOrIrgTcu-nuZRQcFjPgNjhCP_Ski86rddpkLbpTWGZiiFFGYO5bNiPcXKIATJHDwdpR-ernEilvGK2phrje5RTV7MnQw5ig=w640-h133" width="640" /></a></div><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrck3XWlUZwmMwyo5sjnVrdQMrx5x8b_M0zXVi_LZIiNt_EFoVtl_8IeXAjxaV3CUX_YwZOEbFGcSClycNXlytAAfkLQo-uimymVnJl8uRUAIchliXq3OnnnhW1WiFldSGK9cBJMPZ5R5_MvvxclaQpLa5ZFj1IbPAtkwrQU6rlDWUHtrFIkVhju4k/s539/wsl-microsoft.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a></div><br /><p> Abrimor nuestro Powershell con derechos de administración y ejecutamos:</p><p></p><blockquote>wsl --install</blockquote><p></p><p>Entonces veremos lo siguiente:</p><blockquote><p>Instalando: Plataforma de máquina virtual</p><p>Se ha instalado Plataforma de máquina virtual.</p><p>Instalando: Subsistema de Windows para Linux</p><p>Se ha instalado Subsistema de Windows para Linux.</p><p>Descargando: Kernel de WSL</p><p>Instalando: Kernel de WSL</p><p>Se ha instalado Kernel de WSL.</p><p>Descargando: Soporte técnico de la aplicación de GUI</p><p>Instalando: Soporte técnico de la aplicación de GUI</p><p>Se ha instalado Soporte técnico de la aplicación de GUI .</p><p>Descargando: Ubuntu</p><p>La operación solicitada se realizó correctamente. Los cambios se aplicarán una vez que se reinicie el sistema.</p></blockquote><p></p><p>Así pues.. a reiniciar el sistema. Una vez reiniciado, automáticamente acabará de actualizar lo necesario y te pedirá ya el nombre de usuario y contraseña que quieras para tu Ubuntu.</p><p><br /></p><p>Enlaces de interés:</p><p></p><ul style="text-align: left;"><li><a href="https://docs.microsoft.com/ca-es/windows/wsl/install">Instalación de WSL | Microsoft Docs</a></li></ul><p></p><p><br /></p><p><br /></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-68029422509614472832022-03-09T11:58:00.000+01:002022-03-09T11:58:40.161+01:00Linux Performance Observability Tools<p> </p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgBBZjbZSUvWz5S_eJfpK071YGv_wwIL3sEQGamwpc7pLLnX8wuhmvcN1yyqcQFfPg_vnn-igt5pb5y7rA95xLMpLorGJi2yY-5cxQ2C1N76HGqKStS8iNeOxpnhgzHCDz10NONOjZRQvOemvXSAxmQdYvvZB4PdhQ1jAx6b58iLZi4gEue1HGRuTH2" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="618" data-original-width="956" height="414" src="https://blogger.googleusercontent.com/img/a/AVvXsEgBBZjbZSUvWz5S_eJfpK071YGv_wwIL3sEQGamwpc7pLLnX8wuhmvcN1yyqcQFfPg_vnn-igt5pb5y7rA95xLMpLorGJi2yY-5cxQ2C1N76HGqKStS8iNeOxpnhgzHCDz10NONOjZRQvOemvXSAxmQdYvvZB4PdhQ1jAx6b58iLZi4gEue1HGRuTH2=w640-h414" width="640" /></a></div><br /><p></p><p>Fuente: <a href="https://www.brendangregg.com/linuxperf.html">Linux Performance (brendangregg.com)</a></p><p><br /></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-73960742934434569542021-12-24T12:25:00.001+01:002021-12-24T12:25:13.984+01:00Arbol de Navidad en nuestro terminal<p>Primero os podeis descargar el ejecutable desde su web</p><pre style="background: none 0px 0px repeat scroll rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.1); box-sizing: border-box; color: #3a3a3a; font-size: 16px; line-height: 1.7; margin-bottom: 1.333em; margin-top: 1.333em; outline: none; overflow-wrap: normal; overflow: auto hidden; padding: 1.3333em; word-break: break-all;">$ wget -d -c -O "christmas.sh" "https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh"</pre><p style="background-color: white; box-sizing: border-box; color: #313131; font-family: "Open Sans", sans-serif; font-size: 15px; line-height: 1.8; margin: 0px 0px 17px; outline: none; padding: 0px;">Hacerlo ejecutable</p><pre style="background: none 0px 0px repeat scroll rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.1); box-sizing: border-box; color: #3a3a3a; font-size: 16px; line-height: 1.7; margin-bottom: 1.333em; margin-top: 1.333em; outline: none; overflow-wrap: normal; overflow: auto hidden; padding: 1.3333em; word-break: break-all;">$ chmod +x christmas.sh</pre><p style="background-color: white; box-sizing: border-box; color: #313131; font-family: "Open Sans", sans-serif; font-size: 15px; line-height: 1.8; margin: 0px 0px 17px; outline: none; padding: 0px;">y... ¡a disfrutar de vuestro arbolito!</p><pre style="background: none 0px 0px repeat scroll rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.1); box-sizing: border-box; color: #3a3a3a; font-size: 16px; line-height: 1.7; margin-bottom: 1.333em; margin-top: 1.333em; outline: none; overflow-wrap: normal; overflow: auto hidden; padding: 1.3333em; word-break: break-all;">$ ./christmas.sh</pre><br /><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiALpTvSS2YOht80C6RZLrQa7_LTzB8ddf4hC2FUppAtIKGzMKsn4-D4-PlbQHNm5efKN7P2dugrYbpfGVIm9Xr3UfTV9IPDw1FCsz7qVmHV0tkGN9uW4FX4cVaVCYM7j9ajwF-3x2nGC4/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="287" data-original-width="353" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiALpTvSS2YOht80C6RZLrQa7_LTzB8ddf4hC2FUppAtIKGzMKsn4-D4-PlbQHNm5efKN7P2dugrYbpfGVIm9Xr3UfTV9IPDw1FCsz7qVmHV0tkGN9uW4FX4cVaVCYM7j9ajwF-3x2nGC4/" width="295" /></a></div><br /><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-59514320214150659092021-12-02T07:00:00.001+01:002021-12-02T07:00:00.168+01:00Instalar Nessus en Kali Linux<p> <b style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">Nessus</b><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">es un programa de escaneo de vulnerabilidades en diversos</span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><a class="mw-redirect" href="http://es.wikipedia.org/wiki/Sistemas_operativos" style="color: #2288bb; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify; text-decoration-line: none;" title="Sistemas operativos">sistemas operativos</a><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">. Consiste en un</span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><a href="http://es.wikipedia.org/wiki/Demonio_%28inform%C3%A1tica%29" style="color: #2288bb; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify; text-decoration-line: none;" title="Demonio (informática)">daemon</a><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">,</span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><i style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">nessusd</i><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">, que realiza el escaneo en el sistema objetivo, y</span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><i style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">nessus</i><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">, el cliente (basado en consola o gráfico) que muestra el avance e informa sobre el estado de los escaneos. Desde consola</span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><i style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">nessus</i><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">puede ser programado para hacer escaneos programados con</span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"> </span><a class="mw-redirect" href="http://es.wikipedia.org/wiki/Cron_%28unix%29" style="color: #2288bb; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify; text-decoration-line: none;" title="Cron (unix)">cron</a><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;">.</span></p><div style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh69t7D2GV5hI0Try2e_iGSpGU_eTFOIRTmMDwLkicCRyMt9YIVh7SRTY9Iuq4K7O3BAcvDyp5jZcoaoISo8-WMBzqXSAyZsw6_-g4ZtP6xpYDSktJWfYAebDGPwOxNYRwZjF2ME038dVs/s1600/NessusLogoScreen.png" imageanchor="1" style="clear: right; color: #2288bb; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration-line: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh69t7D2GV5hI0Try2e_iGSpGU_eTFOIRTmMDwLkicCRyMt9YIVh7SRTY9Iuq4K7O3BAcvDyp5jZcoaoISo8-WMBzqXSAyZsw6_-g4ZtP6xpYDSktJWfYAebDGPwOxNYRwZjF2ME038dVs/s1600/NessusLogoScreen.png" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 1px solid rgb(238, 238, 238); box-shadow: rgba(0, 0, 0, 0.1) 1px 1px 5px; padding: 5px; position: relative;" /></a>En operación normal, <i>nessus</i> comienza <a href="http://es.wikipedia.org/wiki/Esc%C3%A1ner_de_puertos" style="color: #2288bb; text-decoration-line: none;" title="Escáner de puertos">escaneando los puertos</a> con <a href="http://es.wikipedia.org/wiki/Nmap" style="color: #2288bb; text-decoration-line: none;" title="Nmap">nmap</a> o con su propio escaneador de puertos para buscar puertos abiertos y después intentar varios <a href="http://es.wikipedia.org/wiki/Exploit" style="color: #2288bb; text-decoration-line: none;" title="Exploit">exploits</a> para atacarlo. Las pruebas de vulnerabilidad, disponibles como una larga lista de plugins, son escritos en <b>NASL</b> (<i>Nessus Attack Scripting Language</i>, Lenguaje de Scripting de Ataque Nessus por sus siglas en inglés), un lenguaje scripting optimizado para interacciones personalizadas en redes.</div><br style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;" /><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small;">(Fuente <a href="http://es.wikipedia.org/wiki/Nessus" style="color: #2288bb; text-decoration-line: none;">Wikipedia</a>)</span><br style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;" /><div><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small;"><br /></span></div><div><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">En un artículo anterior explicaba como<a href="https://eithel-inside.blogspot.com/2013/05/instalar-y-usar-tenable-nessus-en.html"> instalar Nessus en un Ubuntu</a>. En esta ocasión quiero explicarlo como hacerlo en un Kali Linux.</span></div><div><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><br /></span></div><div><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">El primer paso es descargarnos el .deb de la pagina oficial:</span></div><a href="https://www.tenable.com/products/nessus/select-your-operating-system"><span style="font-family: inherit;">https://www.tenable.com/products/nessus/select-your-operating-system</span></a><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhImcFSm6iEyccj1pdR3XX0JnwmY3oPCSADA7WX4MzGzsJBWkJP5L0njPYYUBwZnLGd3P2fquZ8_qGU8X8FcnKSvdKvyX8NjXRfhZtcHjy0rSTiw56cLdrxKw0ioQcLj-nrHCsf4LQeWrs/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="885" data-original-width="1742" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhImcFSm6iEyccj1pdR3XX0JnwmY3oPCSADA7WX4MzGzsJBWkJP5L0njPYYUBwZnLGd3P2fquZ8_qGU8X8FcnKSvdKvyX8NjXRfhZtcHjy0rSTiw56cLdrxKw0ioQcLj-nrHCsf4LQeWrs/w636-h324/image.png" width="636" /></a></div><br />Una vez realizado esto, instalamos el paquete:</div><div>dpkg -i Nessus-10.0.1-debian6_amd64.deb</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQw338ybFezm0fNX8ykc7cYLz50SAibvF8Ku01wUhfzGe9ztFHE8X3cfe4SDVqv5OFfvee-uTOXXhrgYh1hzaaPGAVtbALI1ohkr6hw9iSPPvgHW6jD9v8IQ5MyQaDziI82O4jLH1m5S8/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="200" data-original-width="687" height="135" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQw338ybFezm0fNX8ykc7cYLz50SAibvF8Ku01wUhfzGe9ztFHE8X3cfe4SDVqv5OFfvee-uTOXXhrgYh1hzaaPGAVtbALI1ohkr6hw9iSPPvgHW6jD9v8IQ5MyQaDziI82O4jLH1m5S8/w464-h135/image.png" width="464" /></a></div><div><br /></div>Arrancamos el servicio con:</div><div>/bin/systemctl start nessusd.service</div><div><br /></div><div>Y ya podemos conectar a Nessus. Hay que tener en cuenta que nos abrirá un puerto (8834) en localhost. Mira el output en la instalación para ver donde has de conectar. En mi caso es https://kali:8834</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjORjiisTL0ZsaKuY7aJtqC79kMD2Py8Ue9CTufGVWmTkPFKyvjWInwzcOWzkNdA7IjzcKCPbldTn6rKQKmn5mmnBQhcH5jM2W05ZkhpwHI1xkwlKF68sRkd60O7BwDnmtNEqDnWTTjF-M/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="709" data-original-width="1178" height="386" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjORjiisTL0ZsaKuY7aJtqC79kMD2Py8Ue9CTufGVWmTkPFKyvjWInwzcOWzkNdA7IjzcKCPbldTn6rKQKmn5mmnBQhcH5jM2W05ZkhpwHI1xkwlKF68sRkd60O7BwDnmtNEqDnWTTjF-M/w640-h386/image.png" width="640" /></a></div><br />Para nuestra prueba, lo haremos con la licencia Essentials:</div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNN5cR7-pEZbiM-FPziecmmH3XGSYSG6-G28ndgLZ_QnZGuAUQic_uu9lP7KXhr0cGnYA5O9jMm-nKO6Vi44LwmmAsfEgS3AAHhJD12iWe2rboieVz6pcchaTZfeTXDX5sUG4zWZPXun0/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="120" data-original-width="393" height="98" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNN5cR7-pEZbiM-FPziecmmH3XGSYSG6-G28ndgLZ_QnZGuAUQic_uu9lP7KXhr0cGnYA5O9jMm-nKO6Vi44LwmmAsfEgS3AAHhJD12iWe2rboieVz6pcchaTZfeTXDX5sUG4zWZPXun0/" width="320" /></a></div><br /><br />Una vez registrado se descargará y compilará plugins y se inicializará:</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmcrofsuQEO2cSgF3dSLIwYuEtz7LxBCxRfIiHjimvQAolXENJeTvbRgATQSXfm2c6c2iH9dmBODf7X_ubM1q807OP6jmZ_zVteRB7QMkqGqkGHQibNeXxOKBXF0BMySI34vcqnI6N8Lc/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="398" data-original-width="421" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmcrofsuQEO2cSgF3dSLIwYuEtz7LxBCxRfIiHjimvQAolXENJeTvbRgATQSXfm2c6c2iH9dmBODf7X_ubM1q807OP6jmZ_zVteRB7QMkqGqkGHQibNeXxOKBXF0BMySI34vcqnI6N8Lc/" width="254" /></a></div><br />Con eso ya podrás empezar a usarlo. </div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-64039970797341688912021-12-01T13:45:00.008+01:002021-12-01T14:00:18.842+01:00Cambiar Idioma del sistema en Kali Linux a español<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP_rzzb2315M-uwifFfab2jKqs2vrpYt6IVAqu1GHo4HPfTHNx2Iuq86rUHkRxzox5aktBBaJhazyxzF_gWVtWeF2A9dn2d74QIGWOWjtC6HTb1hgzmyPE0mxf3lLwGFlnrT8w0nNDQJo/" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="" data-original-height="275" data-original-width="664" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP_rzzb2315M-uwifFfab2jKqs2vrpYt6IVAqu1GHo4HPfTHNx2Iuq86rUHkRxzox5aktBBaJhazyxzF_gWVtWeF2A9dn2d74QIGWOWjtC6HTb1hgzmyPE0mxf3lLwGFlnrT8w0nNDQJo/" width="320" /></a></div><b style="background-color: white; color: #202122; font-family: sans-serif; font-size: 14px;">Kali Linux</b><span face="sans-serif" style="background-color: white; color: #202122; font-size: 14px;"> es una distribución basada en </span><a href="https://es.wikipedia.org/wiki/Debian_GNU/Linux" style="background: none rgb(255, 255, 255); color: #0645ad; font-family: sans-serif; font-size: 14px; text-decoration-line: none;" title="Debian GNU/Linux">Debian GNU/Linux</a><span face="sans-serif" style="background-color: white; color: #202122; font-size: 14px;"> diseñada principalmente para la auditoría y </span><a href="https://es.wikipedia.org/wiki/Seguridad_inform%C3%A1tica" style="background: none rgb(255, 255, 255); color: #0645ad; font-family: sans-serif; font-size: 14px; text-decoration-line: none;" title="Seguridad informática">seguridad informática</a><span face="sans-serif" style="background-color: white; color: #202122; font-size: 14px;"> en general. Fue fundada y es mantenida por Offensive Security Ltd. Mati Aharoni y Devon Kearns, ambos pertenecientes al equipo de Offensive Security, desarrollaron la distribución a partir de la reescritura de </span><a href="https://es.wikipedia.org/wiki/BackTrack" style="background: none rgb(255, 255, 255); color: #0645ad; font-family: sans-serif; font-size: 14px; text-decoration-line: none;" title="BackTrack">BackTrack</a><span face="sans-serif" style="background-color: white; color: #202122; font-size: 14px;">, que se podría denominar como la antecesora de Kali Linux.</span> <p></p><p><span style="font-size: xx-small;"><a href="https://es.wikipedia.org/wiki/Kali_Linux" target="_blank">Fuente Wikipedia</a></span></p><p></p><div style="text-align: justify;">Para cambiar el idioma del sistema tenemos que seguir estos pasos:</div><div><br /></div>Comprueba tu idioma actual (opcional)<div><span style="font-family: courier;">env | grep LANG</span></div><div><br /></div><div>Reconfigura los locales:</div><div><span style="font-family: courier;">dpkg-reconfigure locales</span></div><div><br /></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcjflOdewwDYqSvyzeZm-k_gyxle8VULHEr2rUGjo-FLCigKbMgCpsVoz2LFgzy2zwZ6OnVs9khfr0ht367VsROffrZGyDodUcUDIPSmiJLOSS3elngeLx7RlGzmW6WSin_3NsN6-S0M4/" style="clear: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img alt="" data-original-height="87" data-original-width="412" height="68" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcjflOdewwDYqSvyzeZm-k_gyxle8VULHEr2rUGjo-FLCigKbMgCpsVoz2LFgzy2zwZ6OnVs9khfr0ht367VsROffrZGyDodUcUDIPSmiJLOSS3elngeLx7RlGzmW6WSin_3NsN6-S0M4/" width="320" /></a></div><div><p></p><div class="separator" style="clear: both;"><br /></div><div class="separator" style="clear: both;">Desmarca los locales que no te interesan y marca el que quieres. <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8VkHhLWTNxnMtHXWrCofd5Myu_-uy2WScbi96dzIuWFosGbo9kVEN-Xa03HpvozAuOwC0-ANKiG-KhaEuZKqBHWJRdcFQiluVQ67uyUPl2p04CfQZVCNvZB6rLsr6nbxOBYET8oCqN54/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="536" data-original-width="1224" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8VkHhLWTNxnMtHXWrCofd5Myu_-uy2WScbi96dzIuWFosGbo9kVEN-Xa03HpvozAuOwC0-ANKiG-KhaEuZKqBHWJRdcFQiluVQ67uyUPl2p04CfQZVCNvZB6rLsr6nbxOBYET8oCqN54/w619-h271/image.png" width="619" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div></div><div><div>Una vez hecho esto, exportalo al sistema. Para español es:</div><div><span style="font-family: courier;">export LANG=es_ES.UTF-8</span><br /></div></div><div><br /></div><div>También podemos poner el teclado en el idioma:</div><div><span style="font-family: courier;">setxkbmap es</span></div><div><br /></div><div>Reinicia con init 6 o como habitualmente hagas y... ¡listo!</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-7360890090314731802020-02-11T10:24:00.003+01:002020-02-11T10:24:21.371+01:00Arrancar reglas de iptables automáticamente en el boot (netfilter-persistent)<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTMLi2yjck6ws5lyzEC6FBfHogZRughl6eLnh5Vo0dGI1g9Vk3w0lp2cGspr4syc8G3jVzEwuALBCBzv_kyMk_obnOeyrNOuuwR1pGoMpS6nyz8PRU-xhHl5R6Ti1L0-ePpoh-iTiqHgg/s1600/Netfilter-components.svg.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTMLi2yjck6ws5lyzEC6FBfHogZRughl6eLnh5Vo0dGI1g9Vk3w0lp2cGspr4syc8G3jVzEwuALBCBzv_kyMk_obnOeyrNOuuwR1pGoMpS6nyz8PRU-xhHl5R6Ti1L0-ePpoh-iTiqHgg/s1600/Netfilter-components.svg.png" imageanchor="1" style="-webkit-text-stroke-width: 0px; clear: left; color: #0066cc; float: left; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1em; margin-right: 1em; orphans: 2; text-align: center; text-decoration: underline; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTMLi2yjck6ws5lyzEC6FBfHogZRughl6eLnh5Vo0dGI1g9Vk3w0lp2cGspr4syc8G3jVzEwuALBCBzv_kyMk_obnOeyrNOuuwR1pGoMpS6nyz8PRU-xhHl5R6Ti1L0-ePpoh-iTiqHgg/s1600/Netfilter-components.svg.png" imageanchor="1" style="-webkit-text-stroke-width: 0px; clear: right; color: #0066cc; float: right; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1em; margin-left: 1em; orphans: 2; text-align: center; text-decoration: underline; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><img border="0" data-original-height="902" data-original-width="1600" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTMLi2yjck6ws5lyzEC6FBfHogZRughl6eLnh5Vo0dGI1g9Vk3w0lp2cGspr4syc8G3jVzEwuALBCBzv_kyMk_obnOeyrNOuuwR1pGoMpS6nyz8PRU-xhHl5R6Ti1L0-ePpoh-iTiqHgg/s400/Netfilter-components.svg.png" style="cursor: move;" width="400" /></a><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTMLi2yjck6ws5lyzEC6FBfHogZRughl6eLnh5Vo0dGI1g9Vk3w0lp2cGspr4syc8G3jVzEwuALBCBzv_kyMk_obnOeyrNOuuwR1pGoMpS6nyz8PRU-xhHl5R6Ti1L0-ePpoh-iTiqHgg/s1600/Netfilter-components.svg.png"></a><b>Netfilter</b> (o Proyecto Netfilter) es una comunidad de desarrolladores de <a href="https://es.wikipedia.org/wiki/Software">software</a> e ingenieros conocidos principalmente por el <a href="https://es.wikipedia.org/wiki/Framework">framework</a> disponible en el <a href="https://es.wikipedia.org/wiki/N%C3%BAcleo_(inform%C3%A1tica)">núcleo</a> de <a href="https://es.wikipedia.org/wiki/Linux_(n%C3%BAcleo)">Linux</a> que permite interceptar y manipular <a href="https://es.wikipedia.org/wiki/Paquete_de_red">paquetes de red</a>. Dicho <a href="https://es.wikipedia.org/wiki/Framework">framework</a> permite interactuar con paquetes en diferentes etapas del procesamiento dentro del sistema operativo, ofreciendo funcionalidades de <a href="https://es.wikipedia.org/wiki/Cortafuegos_(inform%C3%A1tica)">cortafuegos</a> y otras utilidades relacionadas. Netfilter es el nombre que recibe el proyecto de comunidad y también el conjunto de herramientas software. <br /><br />Las utilidades o componentes más populares en el contexto de Netfilter son <a href="https://es.wikipedia.org/wiki/Nftables">nftables</a> e <a href="https://es.wikipedia.org/wiki/Iptables">iptables</a>, herramientas de <a href="https://es.wikipedia.org/wiki/Cortafuegos_(inform%C3%A1tica)">cortafuegos</a> que permiten no solamente <a href="https://es.wikipedia.org/w/index.php?title=Filtrador_de_paquetes&action=edit&redlink=1">filtrar paquetes</a>, sino también realizar <a href="https://es.wikipedia.org/wiki/Traducci%C3%B3n_de_direcci%C3%B3n_de_red">traducción de direcciones de red</a> (NAT) para <a href="https://es.wikipedia.org/wiki/IPv4">IPv4</a> o mantener registros de <a href="https://es.wikipedia.org/wiki/Log_(registro)">log</a>. El proyecto Netfilter no sólo ofrece componentes disponibles como <a href="https://es.wikipedia.org/wiki/M%C3%B3dulo_de_n%C3%BAcleo">módulos del núcleo</a> sino que también ofrece herramientas de espacio de usuario y librerías. <br /><br />La herramienta nftables (e iptables) son las utilidades de <a href="https://es.wikipedia.org/wiki/Espacio_de_usuario">espacio de usuario</a> mediante las cuales los administradores puede definir políticas de filtrado del tráfico que circula por la red. El nombre iptables se utiliza frecuentemente de forma errónea para referirse a toda la infraestructura ofrecida por el proyecto Netfilter. Sin embargo, el proyecto ofrece otros subsistemas independientes de iptables tales como el connection tracking system o sistema de <a href="https://es.wikipedia.org/wiki/Cortafuegos_stateful">seguimiento de conexiones</a>, que permite encolar paquetes para que sean tratados desde espacio de usuario. iptables es un software disponible en prácticamente todas las <a href="https://es.wikipedia.org/wiki/Distribuci%C3%B3n_Linux">distribuciones de Linux</a> actuales.<br /></div>
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Netfilter">Wikipedia</a>)</span><br />
<br />Hay muchas maneres de conseguir que nuestras reglas se arranquen al inicio del sistema. En esta ocasión os quiero explicar como se hace mediante el <b>servicio netfilter-persistent</b>.<br /><br />Primero configuramos nuestras reglas con iptables. Cuando las tengamos apunto y tengamos confirmado que son esas las reglas que se quieran arrancar al inicio del sistema, instalamos iptables-persistent:<br />
<blockquote class="tr_bq">
<b>apt install iptables-persistent</b><br />Leyendo lista de paquetes... Hecho<br />Creando árbol de dependencias<br />Leyendo la información de estado... Hecho<br />Se instalarán los siguientes paquetes adicionales:<br /> netfilter-persistent<br />Se instalarán los siguientes paquetes NUEVOS:<br /> iptables-persistent netfilter-persistent</blockquote>
<br />
<br />
Al hacerlo, a mitad de instalación nos preguntará si deseamos guardar la configuración actual de nuestras reglas. Es el momento de decirle que si:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibb2naBFN9SqztJ84YW2FR9IXNDRWvkJK8WQdahrPY7d9cLF1f7k5prJyAAyfYFqv3ozee_UOGwgTLpXueSCTqB78pwz47PFqEodwc6bnWkS0z4aVXHcEhIdcXkbg2iv8gsW45UUFt-ww/s1600/Anotaci%25C3%25B3+2020-02-11+095505.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="264" data-original-width="1154" height="145" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibb2naBFN9SqztJ84YW2FR9IXNDRWvkJK8WQdahrPY7d9cLF1f7k5prJyAAyfYFqv3ozee_UOGwgTLpXueSCTqB78pwz47PFqEodwc6bnWkS0z4aVXHcEhIdcXkbg2iv8gsW45UUFt-ww/s640/Anotaci%25C3%25B3+2020-02-11+095505.png" width="640" /></a></div>
<div>
<br /></div>
<div>
Si más adelante cambiamos las reglas, facilmente las podemos actualizar. Estos comandos te seran útiles:</div>
<br />
<span style="-ms-hyphens: none; -webkit-text-stroke-width: 0px; background-color: #f7f7f7; color: #111111; direction: ltr; display: inline !important; float: none; font-family: monospace,monospace; font-size: 0.87rem; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: none; text-transform: none; white-space: pre; word-spacing: normal;"> </span><b style="-webkit-text-stroke-width: 0px; box-sizing: inherit; color: #111111; font-family: monospace,monospace; font-size: 13.93px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">netfilter-persistent</b><span style="-ms-hyphens: none; -webkit-text-stroke-width: 0px; background-color: #f7f7f7; color: #111111; direction: ltr; display: inline !important; float: none; font-family: monospace,monospace; font-size: 0.87rem; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: none; text-transform: none; white-space: pre; word-spacing: normal;"> start<br /> </span><b style="-webkit-text-stroke-width: 0px; box-sizing: inherit; color: #111111; font-family: monospace,monospace; font-size: 13.93px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">netfilter-persistent</b><span style="-ms-hyphens: none; -webkit-text-stroke-width: 0px; background-color: #f7f7f7; color: #111111; direction: ltr; display: inline !important; float: none; font-family: monospace,monospace; font-size: 0.87rem; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: none; text-transform: none; white-space: pre; word-spacing: normal;"> stop<br /> </span><b style="-webkit-text-stroke-width: 0px; box-sizing: inherit; color: #111111; font-family: monospace,monospace; font-size: 13.93px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">netfilter-persistent</b><span style="-ms-hyphens: none; -webkit-text-stroke-width: 0px; background-color: #f7f7f7; color: #111111; direction: ltr; display: inline !important; float: none; font-family: monospace,monospace; font-size: 0.87rem; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: none; text-transform: none; white-space: pre; word-spacing: normal;"> flush<br /> </span><b style="-webkit-text-stroke-width: 0px; box-sizing: inherit; color: #111111; font-family: monospace,monospace; font-size: 13.93px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">netfilter-persistent</b><span style="-ms-hyphens: none; -webkit-text-stroke-width: 0px; background-color: #f7f7f7; color: #111111; direction: ltr; display: inline !important; float: none; font-family: monospace,monospace; font-size: 0.87rem; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: none; text-transform: none; white-space: pre; word-spacing: normal;"> save</span><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br />
<div class="crayon-line crayon-striped-line" id="crayon-5e426c89297c0188378961-2" style="-webkit-text-stroke-width: 0px; background-attachment: scroll; background-clip: border-box; background-color: #f7f7f7; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: currentColor; border-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: currentColor; border-left-style: none; border-left-width: 0px; border-right-color: currentColor; border-right-style: none; border-right-width: 0px; border-top-color: currentColor; border-top-style: none; border-top-width: 0px; color: black; font-family: inherit; font-size: inherit; font-style: normal; font-variant: normal; font-weight: inherit; height: inherit; letter-spacing: normal; line-height: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 5px; padding-right: 5px; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: pre; word-spacing: 0px;">
</div>
<b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br />
Y también podemos comprobar el estado del servicio, arrancarlo y pararlo como cualquier otro servicio.<br />
<br />
<b>systemctl status netfilter-persistent</b><br />
<br />● netfilter-persistent.service - netfilter persistent configuration<br /> Loaded: loaded (/lib/systemd/system/netfilter-persistent.service; enabled; vendor preset: enabled)<br /> Active: <span style="color: lime;">active (exited)</span> since Tue 2020-02-11 10:15:39 CET; 5min ago<br /> Process: 407 ExecStart=/usr/sbin/netfilter-persistent start (code=exited, status=0/SUCCESS)<br /> Main PID: 407 (code=exited, status=0/SUCCESS)<br /><br />
<br />
<b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-6593259688088878672020-01-31T06:30:00.000+01:002020-01-31T06:30:05.552+01:00<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3Xa38WNs53UI7uTGRPT5pTCDSAh-8OjfKMHA_7uhJg6y2HHkLvu_cEOacKQqeF37wxQo2K9kvwSN7dNh5oZVUDB6rKKFBXDk80VpPe43QEukwC3RYWxcMM5I1E-UKECBO_k9IpdBPAPU/s1600/Microsoft-Teams-logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="300" data-original-width="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3Xa38WNs53UI7uTGRPT5pTCDSAh-8OjfKMHA_7uhJg6y2HHkLvu_cEOacKQqeF37wxQo2K9kvwSN7dNh5oZVUDB6rKKFBXDk80VpPe43QEukwC3RYWxcMM5I1E-UKECBO_k9IpdBPAPU/s1600/Microsoft-Teams-logo.png" /></a></div>
<div style="text-align: justify;">
<b>Microsoft Teams</b> es una nueva plataforma creada por <a href="https://es.wikipedia.org/wiki/Microsoft" title="Microsoft">Microsoft</a> que sustenta el trabajo en equipo en las empresas; este tipo de <a href="https://es.wikipedia.org/wiki/Software" title="Software">software</a>, que pone a disposición salas de <a href="https://es.wikipedia.org/wiki/Chat" title="Chat">chat</a>, fuentes de noticias y grupos para el año de las empresas, forma parte del paquete 365 de <a href="https://es.wikipedia.org/wiki/Microsoft_Office_365" title="Microsoft Office 365">Microsoft Office</a> y no puede ser configurado individualmente; con él, se pueden hacer vídeos por <a href="https://es.wikipedia.org/wiki/Twitch" title="Twitch">Twitch</a>, compartir archivos y acceder al <a href="https://es.wikipedia.org/wiki/Bloc_de_notas" title="Bloc de notas">Bloc de notas</a>, <a class="new" href="https://es.wikipedia.org/w/index.php?title=IPages&action=edit&redlink=1" title="IPages (aún no redactado)">IPages</a>, <a href="https://es.wikipedia.org/wiki/Microsoft_PowerPoint" title="Microsoft PowerPoint">Powerpoint</a> y <a href="https://es.wikipedia.org/wiki/Microsoft_OneNote" title="Microsoft OneNote">OneNote</a>.<sup class="reference separada" id="cite_ref-1"><a href="https://es.wikipedia.org/wiki/Microsoft_Teams#cite_note-1">1</a></sup>
</div>
<div style="text-align: justify;">
<a href="https://es.wikipedia.org/wiki/Microsoft" title="Microsoft">Microsoft</a> Teams proporciona servicios inteligentes a través de <a href="https://es.wikipedia.org/wiki/Microsoft" title="Microsoft">Microsoft</a> Graph y de tener en cuenta los grupos de <a href="https://es.wikipedia.org/wiki/Microsoft_Office_365" title="Microsoft Office 365">Office 365</a>.
</div>
<div style="text-align: justify;">
<a href="https://es.wikipedia.org/wiki/Microsoft" title="Microsoft">Microsoft</a>
ha hecho las conversaciones visibles por defecto para todo el equipo,
pero siempre existirá la opción de entablar charlas privadas. Otras
características de <a href="https://es.wikipedia.org/wiki/Microsoft" title="Microsoft">Microsoft</a>
Teams son la capacidad de personalización, el uso de notificaciones, el
aprovechamiento de servicios de terceros y la promesa de la seguridad,
con datos que se cifran tanto en tránsito como en reposo.</div>
<br />
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Microsoft_Teams">Wikipedia</a>)</span><br />
<br />
Hace falta añadir el respositorio oficial:<br />
<br />
<code>https://packages.microsoft.com/repos/ms-teams stable main</code><br />
<code> </code> <br />
al sources.list, añadir el certificado de Microsoft<br />
<blockquote class="tr_bq">
sudo vim sources.list<br />
wget -qO - https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -</blockquote>
<blockquote>
sudo apt update<br />apt search teams</blockquote>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm_3LAp-My-EvVfDzMeWuu-1QHqmx9mmMEflq_20z8YILw8rax9EvTiP6fmuE5_Cvi5NIriKImnHP_9rrxcEQodx3pYr3FMnpxt7HXrekrgK4XqB5zcc4jamq4GtEz-U15PTKlRg54jxM/s1600/Captura+de+pantalla+de+2020-01-30+12-06-12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="733" data-original-width="700" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm_3LAp-My-EvVfDzMeWuu-1QHqmx9mmMEflq_20z8YILw8rax9EvTiP6fmuE5_Cvi5NIriKImnHP_9rrxcEQodx3pYr3FMnpxt7HXrekrgK4XqB5zcc4jamq4GtEz-U15PTKlRg54jxM/s320/Captura+de+pantalla+de+2020-01-30+12-06-12.png" width="305" /></a></div>
<br />
<br />
Y ya podemos empezar a trabajar en equipo!<br />
<br />
Más información: <a href="https://docs.microsoft.com/en-us/microsoftteams/get-clients#linux">https://docs.microsoft.com/en-us/microsoftteams/get-clients#linux</a></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-40181416034738147912020-01-10T07:22:00.000+01:002020-01-10T07:22:10.341+01:00Backup de una base de datos MaxDB desde Linux<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="-webkit-text-stroke-width: 0px; color: #222222; font-family: sans-serif; font-size: 13.93px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0px; orphans: 2; text-align: justify; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc0Cv3QLitObqiG0DY8ebWd3gV5QDmYC4yrEvXgtS8fFB9QbODEcbrTmh_pk0sfB2UZAOW9HOKLAFuF6ykJ7Pq8CSDwCpGCbMHo_IZupCwWu1dM1Un5h_9d-GiHq21hDUBvPUt2NLqghc/s1600/Anotaci%25C3%25B3+2020-01-09+141027.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc0Cv3QLitObqiG0DY8ebWd3gV5QDmYC4yrEvXgtS8fFB9QbODEcbrTmh_pk0sfB2UZAOW9HOKLAFuF6ykJ7Pq8CSDwCpGCbMHo_IZupCwWu1dM1Un5h_9d-GiHq21hDUBvPUt2NLqghc/s1600/Anotaci%25C3%25B3+2020-01-09+141027.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="53" data-original-width="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc0Cv3QLitObqiG0DY8ebWd3gV5QDmYC4yrEvXgtS8fFB9QbODEcbrTmh_pk0sfB2UZAOW9HOKLAFuF6ykJ7Pq8CSDwCpGCbMHo_IZupCwWu1dM1Un5h_9d-GiHq21hDUBvPUt2NLqghc/s1600/Anotaci%25C3%25B3+2020-01-09+141027.png" /></a></div>
<div style="text-align: justify;">
MaxDB es un sistema de administración de <a href="https://es.wikipedia.org/wiki/Base_de_datos">bases de datos</a> adquirido por la compañía <a href="https://es.wikipedia.org/wiki/SAP_AG">SAP</a> para usarse como un repositorio de datos para las aplicaciones de SAP. Desde su adquisición fue nombrado SapDB y, posteriormente, renombrado a MaxDB por <a href="https://es.wikipedia.org/wiki/MySQL_AB">MySQL AB</a>. Antes de SapDB, la base de datos pasó por otros nombres. Originalmente, se llamaba <a href="https://es.wikipedia.org/wiki/Adabas_D">Adabas D</a>, una base de datos pre-<a href="https://es.wikipedia.org/wiki/Base_de_datos_relacional">relacional</a>.<br /></div>
<div style="text-align: justify;">
MaxDB fue liberado desde la versión SapDB 7.2 y es de uso gratuito en ambientes no SAP. Como consecuencia de su adquisición por parte de MySQL AB, MaxDB está bajo licencia <a href="https://es.wikipedia.org/wiki/Licencia_p%C3%BAblica_general_de_GNU">GPL</a> y las interfaces de programación están bajo licencia <a href="https://es.wikipedia.org/wiki/Licencia_p%C3%BAblica_general_limitada_de_GNU">LGPL</a>. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: left;">
Desde la versión 7.5 en adelante SapDB fue adquirido por MySQL AB, la misma compañía que desarrolla la base de datos de código abierto <a href="https://es.wikipedia.org/wiki/MySQL">MySQL</a>, aunque el desarrollo todavía está a cargo de <a href="https://es.wikipedia.org/wiki/SAP_AG">SAP AG</a>. <br /><br /><span style="font-size: x-small;">(Fuente: <a href="https://es.wikipedia.org/wiki/MaxDB">Wikipedia</a>)</span><br /><br /><br />Las pruebas estan realizadas desde una máquina EC2 Machine (AWS) pero se pueden aplicar a cualquier distribución de GNU/Linux. <br /><br /><span style="font-family: "Courier New", Courier, monospace;">BACKUP_EXPORT_DIR="/data/export"<br />BACKUP_FILE="SERVER_BACKUP"<br />BACKUP_RSYNC="<span style="-webkit-text-stroke-width: 0px; background-color: white; color: black; direction: ltr; display: inline !important; float: none; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">SERVER</span>_MAXDB"<br />DBMCLI="/opt/sdb/programs/bin/dbmcli"<br />REPLICA_LOG="/home/ec2-user/logs/replica_maxdb_$(date +%d-%m-%y).log"<br />DBA_USER="userDBA"<br />DBA_PASSWORD="supersecretpassword"<br /><div>
DB="SIGMA"</div>
<div>
<br /></div>
function echodate(){<br />echo -e "\n$(date +%d-%m-%y_%H:%M)::$*" >>${REPLICA_LOG} 2>&1<br /><div>
}</div>
<div>
<br /></div>
echo "$(date +%d-%m-%y_%H:%M):Inicio backup. 10 minutos aprox..."<br />echodate "********************"<br />echodate "** Inicio backup **"<br />echodate "********************"<br /><div>
<br /></div>
{<br />if [ ! -d $BACKUP_EXPORT_DIR ]; then<br /> mkdir -p $BACKUP_EXPORT_DIR<br /> sudo chown ec2-user:sdba $BACKUP_EXPORT_DIR<br /> chmod 775 $BACKUP_EXPORT_DIR<br />fi<br />rm -rf $BACKUP_EXPORT_DIR/${BACKUP_FILE}*<br />nice -n20 $DBMCLI -d $DB -u ${DBA_USER},${DBA_PASSWORD} << EOF<br /> util_connect<br /> medium_put <span style="-webkit-text-stroke-width: 0px; background-color: white; color: black; direction: ltr; display: inline !important; float: none; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">SERVER</span>_BACKUP "${BACKUP_EXPORT_DIR}/${BACKUP_FILE}" FILE DATA 0 8 NO<br /> medium_put <span style="-webkit-text-stroke-width: 0px; background-color: white; color: black; direction: ltr; display: inline !important; float: none; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">SERVER</span>_BACKUP_LOGS "${BACKUP_EXPORT_DIR}/${BACKUP_FILE}_LOGS" FILE LOG 0 8 NO<br /> db_connect<br /> backup_start <span style="-webkit-text-stroke-width: 0px; background-color: white; color: black; direction: ltr; display: inline !important; float: none; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">SERVER</span>_BACKUP<br /> backup_start <span style="-webkit-text-stroke-width: 0px; background-color: white; color: black; direction: ltr; display: inline !important; float: none; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">SERVER</span>_BACKUP_LOGS<br />EOF</span><br />La parte más significativa és la que comienza con el nice -n20, que és donde se ejecuta el dump de la base de datos MaxDB.<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-37214930809719016342017-06-16T10:38:00.000+02:002017-06-16T10:38:05.076+02:00Migrando de owncloud 8.2 a nextcloud 11 de un servidor a otro en Ubuntu 17.04<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Nextcloud_Logo.svg/1280px-Nextcloud_Logo.svg.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="567" data-original-width="800" height="226" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Nextcloud_Logo.svg/1280px-Nextcloud_Logo.svg.png" width="320" /></a></div>
<div style="text-align: justify;">
<b style="font-weight: bold;">Nextcloud</b> es un completo software que nos permitirá sincronizar archivos, carpetas, calendarios y contactos entre múltiples dispositivos. Esto no es nada nuevo, ya que los servicios de Google lo hacen, pero este software nos permite tener el control total de todos nuestros datos, ya que dichos datos se almacenan localmente en nuestra red local, no se suben a ninguna nube pública ni servidor externo si no queremos.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Nextcloud está centrado específicamente en proporcionar a sus usuarios seguridad, privacidad y el control total de todos sus datos, de tal forma que sean totalmente transparentes. Este software es la siguiente generación de sincronización de archivos que empezó con ownCloud, sin embargo, Nextcloud es mucho más avanzado y está en continuo desarrollo por parte de su equipo y también por la comunidad ya que es de código abierto.</div>
<br />
<span style="font-size: xx-small;">(Fuente: <a href="https://www.redeszone.net/nextcloud/#sthash.hvmlm8ts.dpuf">RedesZone</a>)</span><br />
<br />
En un tutorial anterior os explicaba como instalar owncloud:<br />
<ul style="text-align: left;">
<li><a href="http://eithel-inside.blogspot.com.es/2015/02/owncloud-https-mysql-openldap-en-ubuntu.html">ownCloud + https + MySQL + openLDAP en Ubuntu 14.04 LTS</a></li>
</ul>
<br />
Este tutorial mostrará un procedimiento para migrar nuestro servidor ownCloud v8.2 <b>de una máquina, a otra máquina diferente</b> en donde querremos tener Nextcloud. Si la migración se hace en la misma máquina, el procedimiento es practicamente el mismo si bien no hay que transferir las copias de la base de datos y archivos de una a otra. Una cosa que tenemos que tener clara es la escalera de migraciones que debemos realizar:<br />
<ul style="text-align: left;">
<li>ownCloud 8.2 y 9.0 a Nextcloud 9.</li>
<li>ownCloud 9.0 y 9.1 a Nextcloud 10</li>
<li>ownCloud 9.1 a Nextcloud 10 or 11.</li>
</ul>
<span style="font-size: xx-small;">(Fuente </span><a href="https://help.nextcloud.com/t/migrating-from-owncloud-to-nextcloud/551" style="font-size: x-small;">nextcloud</a><span style="font-size: xx-small;">)</span><br />
<br />
Esto quiere decir, que si tengo (como es el caso) un owncloud 8.2, si deseo pasarlo a nextcloud 12, tendré que hacer una migración previa a nextcloud 9. Entendido esto, vamos a hacerlo:<br />
<br />
Descarga: https://nextcloud.com/install/<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">wget https://download.nextcloud.com/server/releases/nextcloud-9.0.58.zip</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">--2017-06-15 11:16:27-- https://download.nextcloud.com/server/releases/nextcloud-9.0.58.zip</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Resolviendo download.nextcloud.com (download.nextcloud.com)... 88.198.160.133</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Conectando con download.nextcloud.com (download.nextcloud.com)[88.198.160.133]:443... conectado.</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Petición HTTP enviada, esperando respuesta... 200 OK</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Longitud: 44682063 (43M) [application/zip]</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Guardando como: “nextcloud-9.0.58.zip”</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;">nextcloud-9.0.58.zip 100%[======================>] 42,61M 7,99MB/s in 5,7s </span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;">2017-06-15 11:16:33 (7,50 MB/s) - “nextcloud-9.0.58.zip” guardado [44682063/44682063]</span></blockquote>
</blockquote>
<div>
Luego descomprimimos con unzip: </div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">unzip nextcloud-9.0.58.zip</span></div>
<div>
<br /></div>
Y obtendremos el software listo para instalarlo. Pero nosotros en este tutorial lo que queremos es migrar de owncloud a nextcloud, y no hacer una instalación nueva. Para ello necesitaremos:<br />
<br />
<ul style="text-align: left;">
<li>Instalar un nuevo servidor LAMP</li>
<li>Hacer copia de seguridad de la base de datos de owncloud y restaurarla en el nuevo servidor</li>
<li>Hacer copia de los archivos (./data) de owncloud y copiarlo en el nuevo servidor.</li>
<li>Hacer copia de seguridad de la configuración de owncloud (./config) y restaurarlo en el nuevo servidor.</li>
</ul>
<br />
Por ejemplo, en mi caso tengo una copia de seguridad de la base de datos de owncloud. Me la copio al nuevo servidor y la descomprimo. Luego:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">CREATE DATABASE IF NOT EXISTS nextcloud;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mysql --user=root --password nextcloud < owncloud-sqlbkp.bak</span><br />
<br />
<br />
Creamos el site nextcloud en el apache del nuevo servidor:<br />
<br />
<pre style="background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; color: #333333; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.42857; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">Alias /nextcloud "/var/www/nextcloud/"
<directory nextcloud="" var="" www="">
Options +FollowSymlinks
AllowOverride All
<ifmodule mod_dav.c="">
Dav off
</ifmodule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</directory></pre>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">a2ensite nextcloud.conf</span><br />
<br />
<br />
Tambien es aconsejable habilitar los siguientes módulos:<br />
<pre style="background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; color: #333333; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.42857; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime</pre>
<br />
Instalamos algunos paquetes php extras que nos irán bien<br />
<blockquote class="tr_bq">
apt install php7.0-curl php7.0-json php7.0-cgi php7.0-xml memcached php-memcached php-zip php-mbstring php7.0-gd</blockquote>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">systemctl reload apache2</span><br />
<br />
Como el objetivo de este tutorial no es enseñar a instalar un owncloud o nextcloud, daremos por conocidos esos conceptos.<br />
<br />
En este punto ya estamos preparados para poder realizar la migración:<br />
<br />
<b>http://</b><mi_ip><b>/nextcloud/updater/</b></mi_ip><br />
<br />
Ahora nos pedirá una clave de actualización. Esta será la que tengamos configurado en nuestro config.php, pero en el caso de no acordarnos la podemos regenerar desde el terminal :<br />
<blockquote class="tr_bq">
<span style="background-color: #eeeeee; font-family: monospace; font-size: 12.48px;">php -r '$password = trim(shell_exec("openssl rand -base64 48"));if(strlen($password) === 64) {$hash = password_hash($password, PASSWORD_DEFAULT) . "\n"; echo "Insert as \"updater.secret\": ".$hash; echo "The plaintext value is: ".$password."\n";}else{echo "Could not execute OpenSSL.\n";};'</span></blockquote>
También se puede hacer por linea de comandos. De hecho, para servidores con gran cantidad de información es aconsejable ya que los tiempos de espera de PHP nos podrían cancelar la actualización.<br />
<div>
<br /></div>
<div>
<b>sudo -u www-data php occ upgrade</b></div>
<div>
<div>
<i>Nextcloud or one of the apps require upgrade - only a limited number of commands are available</i></div>
<div>
<i>You may use your browser or the occ upgrade command to do the upgrade</i></div>
<div>
<i> - Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE `*PREFIX*filecache` ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;</i></div>
<div>
<i>Continue with update (y/n)</i></div>
<div>
<i>y</i></div>
<div>
<i>Set log level to debug</i></div>
<div>
<i>Checking whether the database schema can be updated (this can take a long time depending on the database size)</i></div>
</div>
<div>
(...)</div>
<div>
<br />Al finalizar la actualización hacemos:<br />
<br />
<b>sudo -u www-data php occ maintenance:mode --off</b><br />
Nextcloud is in maintenance mode - no app have been loaded<br />
Maintenance mode disabled<br />
<div>
<br /></div>
Y .. ¡¡ tachán!! ya lo tendremos en Nextcloud 9!. Ahora toca actualizarlo hasta la 11. Para ello usaremos las propias indicaciones del nextcloud. Podemos hacerlo mediante linea de comandos o ayudándonos con el actualizador de nextcloud:<br />
<ol style="text-align: left;">
<li>Activar Modo mantenimiento<br /><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo -u www-data php occ maintenance:mode --on</span></li>
<li>Hacer copia de la configuración (<i>config/config.php</i>), base de datos y carpeta <b>data</b></li>
<li>Borrar el código antiguo de nextcloud y colocar la nueva versión</li>
<li>Restablecer configuración (config.php) y carpeta <b>data</b>.</li>
<li>Lanzar el comando para realizar la actualización<br /><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo -u www-data php occ upgrade</span></li>
<li>Desactivar Modo mantenimiento<br /><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo -u www-data php occ maintenance:mode --off</span></li>
</ol>
</div>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-29999156586838084972016-09-28T11:10:00.004+02:002016-09-28T11:10:35.632+02:00Daemon Stop!<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqSQ9OxiBYrX_y_oxLl6f3Zp8upn7SQhx5TP6p5y0vt-tL3YFJ6gtRvVWYlkGjNr8scP-oHsJ9S5JyZJL5JgbBuegLp5LiNmYagJ7h41ky4q2hnV3zX_REleVhgT_AOkJyEFzQNhlcWq4/s1600/humor-linux-desmotivaciones.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="522" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqSQ9OxiBYrX_y_oxLl6f3Zp8upn7SQhx5TP6p5y0vt-tL3YFJ6gtRvVWYlkGjNr8scP-oHsJ9S5JyZJL5JgbBuegLp5LiNmYagJ7h41ky4q2hnV3zX_REleVhgT_AOkJyEFzQNhlcWq4/s640/humor-linux-desmotivaciones.jpg" width="640" /></a></div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-33898326840181599182016-09-27T12:06:00.000+02:002016-09-27T12:06:07.462+02:00OCFS2 (Oracle Cluster File System) + VMWare Multi-Writer<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: right;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizdXQDi8bArS0_hI1lFvqFUhHUSOI0YtJLrMbAdZiNY08gvktW4woy1vBMqW05AkrGb2qZ5uw5yI9OYUWXIFPg1EiaQnrf2LwUWgrKaPkLl3yPTNQGgvT6CNwxYGWJUQyRWYCYs-25CuA/s1600/OCFS2+console.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizdXQDi8bArS0_hI1lFvqFUhHUSOI0YtJLrMbAdZiNY08gvktW4woy1vBMqW05AkrGb2qZ5uw5yI9OYUWXIFPg1EiaQnrf2LwUWgrKaPkLl3yPTNQGgvT6CNwxYGWJUQyRWYCYs-25CuA/s320/OCFS2+console.png" width="320" /></a></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
<b>OCFS</b> (<i><b>O</b>racle <b>C</b>luster <b>F</b>ile <b>S</b>ystem</i>) es un sistema de archivos de discos compartidos o sistema de archivos distribuido para clusteres de servidores de sistemas GNU/Linux desarrollado por <a href="https://es.wikipedia.org/wiki/Oracle_Corporation" style="background: none; color: #0b0080; text-decoration: none;" title="Oracle Corporation">Oracle Corporation</a> distribuidos bajo los términos de la <a href="https://es.wikipedia.org/wiki/GNU_General_Public_License" style="background: none; color: #0b0080; text-decoration: none;" title="GNU General Public License">GNU General Public License</a>.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
La primera versión de OCFS se desarrolló con el objetivo de albergar los archivos de la base de datos de Oracle en entornos clusterizados.Con la segunda versión del sistema las características POSIX fueron incluidas.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
OCFS2 (versión 2) fué integrada dentro de la versión 2.6.16 del kernel de Linux. Inicialmente se marcó como código experimental (Alpha-test). Esta restricción se levantó en la versión 2.6.19. Con la versión de kernel 2.6.29 se añadieron más funcionabilidades como ACLS (access control lists) y cuota <sup class="reference" id="cite_ref-2" style="line-height: 1em; unicode-bidi: isolate; white-space: nowrap;"><a href="https://es.wikipedia.org/wiki/OCFS2#cite_note-2" style="background: none; color: #0b0080; text-decoration: none;">2</a></sup></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em;">
<br /></div>
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/OCFS2">Wikipedia</a>) </span><div>
<span style="font-size: xx-small;"><br /></span></div>
<div>
La idea básica de este sistema de archivos es, dado un servidor de almacenamiento, compartir dicho almacenamiento entre diferentes servidores. Para ello, crearemos un almacenamiento compartido (shared storage) e instalaremos un sistema de archivos capaz de trabajar en clúster. Esto es importante ya que si miramos de usar un disco compartido con un sistema de archivos que no tenga capacidades de cluster crearía inconsistencia de datos. Luego veremos un ejemplo. </div>
<div>
Este sería el esquema que planteo:</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8c-Fii_FZD7OqIQrtQFm11ZSCuYPUX-BNOMvo6vg5F_BPXmHmArCh6wABG46K_ivQXyU_0GXkRKT2lPKdgCNn3BfKTSosFoV-D7uEQS9cjhrCtPJWvJ4SWhnVo-SX_Do7QHNrdH51bpY/s1600/OCFS2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="524" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8c-Fii_FZD7OqIQrtQFm11ZSCuYPUX-BNOMvo6vg5F_BPXmHmArCh6wABG46K_ivQXyU_0GXkRKT2lPKdgCNn3BfKTSosFoV-D7uEQS9cjhrCtPJWvJ4SWhnVo-SX_Do7QHNrdH51bpY/s640/OCFS2.png" width="640" /></a></div>
<div>
Para crear el disco compartido podríamos basarnos, por ejemplo, en <a href="https://communities.vmware.com/blogs/Abhilash_hb/2013/08/25/clustering-using-sharing-of-vmdks-between-virtual-machines">VMWare creando un disco duro virtual con acceso de escritura desde cualquier máquina y luego activar los flags multi-writer</a>. Como el objetivo de este blog no es enseñar a usar características de VMWare, os dejo el enlace para que podáis hacerlo si fuera necesario. Sino, podéis usar una SAN o cualquier otro sistema que conozcáis para compartir almacenamiento.</div>
<div>
Por otro lado, necesitamos que el sistema de archivos esté preparado para trabajar con clúster y en esta ocasión trabajaremos con OCFS2. Para instalarlo en nuestro sistema usaremos apt:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwuDk_ELMTGNMg8zssuMu6Pka5H_W3a0F-Q9ucdb-SDoWMoKw8rJxDaXMviTPYzBeCOqEtLpP4s6WHSArKHWeenJ0Yfzt7LVHTbrLgcZ-yyP_r16TXpJsGBQIYm9wOUXokReMdybCrqxI/s1600/Captura+de+pantalla+de+2016-09-27+10-26-29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwuDk_ELMTGNMg8zssuMu6Pka5H_W3a0F-Q9ucdb-SDoWMoKw8rJxDaXMviTPYzBeCOqEtLpP4s6WHSArKHWeenJ0Yfzt7LVHTbrLgcZ-yyP_r16TXpJsGBQIYm9wOUXokReMdybCrqxI/s640/Captura+de+pantalla+de+2016-09-27+10-26-29.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Así pues:</div>
<div>
<span style="font-family: Courier New, Courier, monospace;">apt-get install ocfs2-tools</span></div>
<div>
<br /></div>
<div>
Si tenéis una versión con escritorio también podeis instalar ocfs2console. Para este tutorial nos basaremos en servidores sin ventanas.</div>
<div>
<br /></div>
<div>
Lo primero que haremos es definir dos nodos que accederán al recurso compartido (disco compartido). Podrían ser tantos nodos como queramos, pero empecemos por dos. También declararemos un cluster que nos servirá para enlazar los nodos:</div>
<div>
<br /></div>
<div>
Creamos el archivo <strong style="background: rgb(255, 255, 255); border: 0px; color: #333333; font-family: Georgia, "Times New Roman", serif; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">/etc/ocfs2/cluster.conf</strong>:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><div>
cluster:</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>node_count = 2</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>name = ocfs2</div>
<div>
<br /></div>
<div>
node:</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>ip_port = 7777</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>ip_address = 192.168.1.100</div>
</span><span style="font-family: Courier New, Courier, monospace;"><div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>number = 1</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>name = node3</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>cluster = ocfs2</div>
<div>
<br /></div>
<div>
node:</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>ip_port = 7777</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>ip_address = 192.168.1.101</div>
</span><span style="font-family: Courier New, Courier, monospace;"><div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>number = 2</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>name = node4</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>cluster = ocfs2</div>
<div>
<br /></div>
</span></div>
<div>
<div>
Es bastante sencillo entender la configuracón. Declaramos un cluster de dos maquinas (<span style="font-family: "Courier New", Courier, monospace;">node_count = 2</span>) al que llamamos ocfs2 (<span style="font-family: "Courier New", Courier, monospace;">name = ocfs2</span>). Luego declaramos dos nodos a los que le ponemos la ip que tienen (<span style="font-family: "Courier New", Courier, monospace;">192.168.1.100 etc</span>), les asignamos un nombre a cada nodo (<span style="font-family: "Courier New", Courier, monospace;">name = mi_nodo1</span>) y los enlazamos con el cluster definido (<span style="font-family: "Courier New", Courier, monospace;">cluster = ocfs2</span>). Como nota, deciros que el nombre del cluster 'por defecto' es ocfs2. Podéis cambiarlo, pero tenerlo en cuenta por si algo no os funciona. También tener muy en cuenta el sangrado del archivo. Si no tabulais correctamente el archivo no arrancará el servicio. Os dará un error como este:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZgebdxDB83_7uPXPOuT0JoPlH1SWriQyYQWhjqW37B2CZL8Ud-xTDegozRIlWLnagZDLGWgxb2mzCFPH779SKWRG9SmK40twQIUMcmCcwjnU0MvnUxJbbZUTC_CWv3t6cvdRXu6GsSw4/s1600/Captura+de+pantalla+de+2016-09-27+11-04-18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZgebdxDB83_7uPXPOuT0JoPlH1SWriQyYQWhjqW37B2CZL8Ud-xTDegozRIlWLnagZDLGWgxb2mzCFPH779SKWRG9SmK40twQIUMcmCcwjnU0MvnUxJbbZUTC_CWv3t6cvdRXu6GsSw4/s640/Captura+de+pantalla+de+2016-09-27+11-04-18.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Ahora vamos a cambiar un valor en el otro archivo 'importante' de configuración:</div>
<div>
<b>/etc/default/o2cb</b></div>
<div>
<br /></div>
<div>
Debéis cambiar el valor O2CB_ENABLED a true y dejarlo así:</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">O2CB_ENABLED=true</span></div>
<div>
<br /></div>
<div>
Esto lo que hará es que se cargue el driver al arrancar el sistema operativo, lo cual con casi toda seguridad es lo que querremos. </div>
<div>
<br /></div>
<div>
Ya lo tenemos listo. Nos quedará reiniciar los servicios para que los cambios se apliquen:</div>
<br /><span style="font-family: Courier New, Courier, monospace;">service o2cb restart<br />service ocfs2 restart</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<div>
Ahora bien, todo esto lo hemos hecho en un nodo. Para el otro nodo deberemos instalar también el paquete, editar el <strong style="background: rgb(255, 255, 255); border: 0px; color: #333333; font-family: Georgia, "Times New Roman", serif; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">/etc/ocfs2/cluster.conf</strong> y <b>/etc/default/o2cb</b>.</div>
</div>
<div>
<br /></div>
<div>
<div>
Ahora sólo nos queda formatear el disco compartido (como es compartido, lo hemos de hacer solamente una vez en uno de los nodos) con el sistema de archivos ocfs2. No hace falta particionarlo si vamos a usar todo el disco. Entenderemos que nuestro disco compartido será, para este ejemplo, el /dev/sdb .</div>
<div>
<br /></div>
<div>
<div>
<i>root@node3:/etc/ocfs2#</i> <b>mkfs.ocfs2 -b 4k -C 32K -L "Cluster-OCFS2" -N 4 /dev/sdb</b></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">mkfs.ocfs2 1.6.4</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Cluster stack: classic o2cb</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Label: Cluster-OCFS2</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Features: sparse backup-super unwritten inline-data strict-journal-super xattr</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Block size: 4096 (12 bits)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Cluster size: 32768 (15 bits)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Volume size: 4293918720 (131040 clusters) (1048320 blocks)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Cluster groups: 5 (tail covers 2016 clusters, rest cover 32256 clusters)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Extent allocator size: 4194304 (1 groups)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Journal size: 67108864</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Node slots: 4</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Creating bitmaps: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Initializing superblock: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Writing system files: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Writing superblock: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Writing backup superblock: 1 block(s)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Formatting Journals: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Growing extent allocator: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Formatting slot map: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Formatting quota files: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Writing lost+found: done</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">mkfs.ocfs2 successful</span></div>
</div>
<div>
<br /></div>
<div>
Para montar el disco compartido podemos editar el <b>/etc/fstab</b> añadiendo:</div>
<div>
<br /></div>
<div>
/dev/sdb<span class="Apple-tab-span" style="white-space: pre;"> </span>/mnt/Cluster-OCFS2 ocfs2 defaults<span class="Apple-tab-span" style="white-space: pre;"> </span>0 0</div>
<div>
<br /></div>
<div>
y luego hacer <b>mount -a</b>.</div>
<div>
<br /></div>
<div>
Una vez hecho esto podremos ver que ya trabajamos con el cluster definido:</div>
<div>
<br /></div>
<div>
<div>
root@node3:/mnt# <b>/etc/init.d/ocfs2 status</b></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Configured OCFS2 mountpoints: /mnt/Cluster-OCFS2</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Active OCFS2 mountpoints: /mnt/Cluster-OCFS2</span></div>
</div>
<div>
<br /></div>
<div>
Si montamos el disco compartido en los dos nodos, veremos que lo que vemos y escribimos desde uno tiene visibilidad total en el otro. </div>
<div>
<br /></div>
<div>
Enlaces de interés:</div>
<div>
*<a href="https://communities.vmware.com/blogs/Abhilash_hb/2013/08/25/clustering-using-sharing-of-vmdks-between-virtual-machines">Clustering using sharing of VMDK's between virtual machines</a></div>
<div>
<br /></div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-596958252760274232016-04-28T10:57:00.000+02:002016-04-28T10:57:00.826+02:00Arreglar 'No ha sido posible iniciar Dropbox' (dropbox permissions error)<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3NzsH4I8BCEN8ghkqOfxAO6h9zBXbdp2fhzX4pBtz0VOxOS8iiyZmwvS3kD-l6hS3A7U04v3R24KvC7KxA7djJOTDurA2VnW_gaOjbjZHSMvOZpA_BicNoIkK7fJPJBb1J8p2KZIF3Fg/s1600/Captura+de+pantalla+de+2016-04-28+09-52-13.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="157" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3NzsH4I8BCEN8ghkqOfxAO6h9zBXbdp2fhzX4pBtz0VOxOS8iiyZmwvS3kD-l6hS3A7U04v3R24KvC7KxA7djJOTDurA2VnW_gaOjbjZHSMvOZpA_BicNoIkK7fJPJBb1J8p2KZIF3Fg/s320/Captura+de+pantalla+de+2016-04-28+09-52-13.png" width="320" /></a></div>
<b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">Dropbox</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> es un </span><a href="https://es.wikipedia.org/wiki/Servicio_de_alojamiento_de_archivos" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Servicio de alojamiento de archivos">servicio de alojamiento de archivos</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> </span><a href="https://es.wikipedia.org/wiki/Multiplataforma" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Multiplataforma">multiplataforma</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> </span><a href="https://es.wikipedia.org/wiki/Computaci%C3%B3n_en_la_nube" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Computación en la nube">en la nube</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">, operado por la compañía Dropbox. El servicio permite a los usuarios almacenar y sincronizar archivos en línea y entre ordenadores y compartir archivos y carpetas con otros usuarios y con tabletas y móviles.</span><sup class="reference" id="cite_ref-1" style="background-color: white; color: #252525; font-family: sans-serif; line-height: 1em; unicode-bidi: isolate; white-space: nowrap;"><a href="https://es.wikipedia.org/wiki/Dropbox#cite_note-1" style="background: none; color: #0b0080; text-decoration: none;">1</a></sup><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> También se puede ejecutar el programa WINISIS de UNESCO administrador de bases de datos textuales</span><sup class="reference" id="cite_ref-2" style="background-color: white; color: #252525; font-family: sans-serif; line-height: 1em; unicode-bidi: isolate; white-space: nowrap;"><a href="https://es.wikipedia.org/wiki/Dropbox#cite_note-2" style="background: none; color: #0b0080; text-decoration: none;">2</a></sup><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> . Existen versiones gratuitas y de pago, cada una de las cuales tiene opciones variadas. La versión móvil está disponible para </span><a href="https://es.wikipedia.org/wiki/Android" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Android">Android</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">, </span><a href="https://es.wikipedia.org/wiki/Windows_Phone" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Windows Phone">Windows Phone</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">, </span><a class="mw-redirect" href="https://es.wikipedia.org/wiki/Blackberry" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Blackberry">Blackberry</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> e </span><a href="https://es.wikipedia.org/wiki/IOS" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="IOS">iOS</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> (Apple).</span><br />
<br />
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Dropbox">Wikipedia</a>)</span><br />
<br />
<br />
La clave para arreglar este problema es siempre mirar en el archivo creado en el /tmp y fijarnos en la linea en donde sale el OperationlError. En mi caso (hay muchos otros si buscáis por internet) era este:<br />
<br />
OperationalError: user-defined function raised exception<br />
<br />
Para arreglar el problema he acudido al típico desinstalar e instalar programa, con el aderezo de que hay que borrar unas carpetas ocultas en tu carpeta personal (que no se encarga el purge). Así pues:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get purge nautilus-dropbox</span><br />
<span style="font-family: Courier New, Courier, monospace;">cd ~</span><br />
<span style="font-family: Courier New, Courier, monospace;">mv .dropbox .dropbox.old</span><br />
<span style="font-family: Courier New, Courier, monospace;">mv .dropbox-dist/ .dropbox-dist.old</span><br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install nautilus-dropbox</span><br />
<div>
<br /></div>
<div>
Luego sales de la sesión, vuelves a entrar y ya te pedirá de validarte en dropbox como una instalación nueva. </div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-14543850397201216012016-04-26T09:48:00.001+02:002016-04-26T09:48:19.795+02:00APT y el mensaje "uses weak digest algorithm (SHA1)"<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCarPjfBOa0VHUw-yeKav8RYRLA-TUq6yaaz3Im9YCZIaIofQsAguWiTgpxR9thzg4y2BZS2Nq135yUREV3Ql7YBFNLS6CiJ5J_0LP28to-JliwUwJ17SCFldU_AuQNBlYUNf3B3EaZmM/s1600/365px-SHA-1.svg.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCarPjfBOa0VHUw-yeKav8RYRLA-TUq6yaaz3Im9YCZIaIofQsAguWiTgpxR9thzg4y2BZS2Nq135yUREV3Ql7YBFNLS6CiJ5J_0LP28to-JliwUwJ17SCFldU_AuQNBlYUNf3B3EaZmM/s320/365px-SHA-1.svg.png" width="307" /></a><b>SHA-1</b> ha sido examinado muy de cerca por la comunidad criptográfica pública, y no se ha encontrado ningún ataque efectivo. No obstante, en el año <a href="https://es.wikipedia.org/wiki/2004" style="background: none; color: #0b0080; text-decoration: none;" title="2004">2004</a>, un número de ataques significativos fueron divulgados sobre funciones criptográficas de <i>hash</i> con una estructura similar a SHA-1; lo que ha planteado dudas sobre la seguridad a largo plazo de SHA-1.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
SHA-0 y SHA-1 producen una salida resumen de 160 bits (20 bytes) de un mensaje que puede tener un tamaño máximo de 2<sup style="line-height: 1em;">64</sup> bits, y se basa en principios similares a los usados por el profesor <a class="mw-redirect" href="https://es.wikipedia.org/wiki/Ronald_L._Rivest" style="background: none; color: #0b0080; text-decoration: none;" title="Ronald L. Rivest">Ronald L. Rivest</a> del <a class="mw-redirect" href="https://es.wikipedia.org/wiki/MIT" style="background: none; color: #0b0080; text-decoration: none;" title="MIT">MIT</a> en el diseño de los algoritmos de resumen de mensaje <a href="https://es.wikipedia.org/wiki/MD4" style="background: none; color: #0b0080; text-decoration: none;" title="MD4">MD4</a> y <a href="https://es.wikipedia.org/wiki/MD5" style="background: none; color: #0b0080; text-decoration: none;" title="MD5">MD5</a>.</div>
<br />
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Secure_Hash_Algorithm#SHA-1">Wikipedia</a>)</span><br />
<br />
Desde la publicación de la distribución 16.04 LTS, el soporte para SHA-1 en el comando apt esta discontinuado. Así pues, obtenemos este mensaje de advertencia:<br />
<br />
<b>W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1)</b><br />
<br />
No es nada que podamos hacer más que esperar que los encargados del repositorio den una nueva clave con un algoritmo compatible. Tampoco es muy alarmante dado que de momento es un simple 'warning' (pese a que resulta molesto). No existe ningún parámetro en apt tipo --sha1 . Así que simplemente nos queda esperar que se actualicen los repositorios (los oficiales ya estan actualizados).<br />
<br />
<br />
<b><u>Más información</u></b><br />
<br />
<ul style="text-align: left;">
<li>https://bugs.chromium.org/p/chromium/issues/detail?id=596074</li>
<li>https://lists.debian.org/deity/2016/03/msg00197.html</li>
<li>http://askubuntu.com/questions/760796/how-to-fix-apt-signature-by-key-uses-weak-digest-algorithm-sha1-after-install</li>
<li>https://www.symantec.com/en/uk/page.jsp?id=sha2-transition</li>
</ul>
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-4246753072507935862016-03-03T11:02:00.003+01:002016-03-03T11:29:47.348+01:00Git + Apache + LPAP (no gitweb)<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6cmNtjQvMGS4sbSbTnRKJ_xkHWNcQc-CCG3r8jsPkCyLWU3L__7qcjCN-Z_cYbwMOJqQgTmrOP3Osfg_bmvHo7AhTrn6tSBVCnwY4IT0NHCahiOCRhu9c69vraRMM67cOrS-fp_Rw1R8/s1600/git-logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6cmNtjQvMGS4sbSbTnRKJ_xkHWNcQc-CCG3r8jsPkCyLWU3L__7qcjCN-Z_cYbwMOJqQgTmrOP3Osfg_bmvHo7AhTrn6tSBVCnwY4IT0NHCahiOCRhu9c69vraRMM67cOrS-fp_Rw1R8/s320/git-logo.png" width="320" /></a></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
<b>Git</b> (pronunciado "guit"<sup class="reference" id="cite_ref-:0_2-0" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Git#cite_note-:0-2" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">2</a></sup> ) es un software de <a href="https://es.wikipedia.org/wiki/Control_de_versiones" style="background: none; color: #0b0080; text-decoration: none;" title="Control de versiones">control de versiones</a> diseñado por <a href="https://es.wikipedia.org/wiki/Linus_Torvalds" style="background: none; color: #0b0080; text-decoration: none;" title="Linus Torvalds">Linus Torvalds</a>, pensando en la eficiencia y la confiabilidad del mantenimiento de versiones de aplicaciones cuando éstas tienen un gran número de archivos de <a href="https://es.wikipedia.org/wiki/C%C3%B3digo_fuente" style="background: none; color: #0b0080; text-decoration: none;" title="Código fuente">código fuente</a>. Al principio, Git se pensó como un motor de bajo nivel sobre el cual otros pudieran escribir la interfaz de usuario o <a href="https://es.wikipedia.org/wiki/Front-end_y_back-end" style="background: none; color: #0b0080; text-decoration: none;" title="Front-end y back-end">front end</a> como <a href="https://es.wikipedia.org/wiki/Cogito_(software)" style="background: none; color: #0b0080; text-decoration: none;" title="Cogito (software)">Cogito</a> o <a class="new" href="https://es.wikipedia.org/w/index.php?title=StGIT&action=edit&redlink=1" style="background: none; color: #a55858; text-decoration: none;" title="StGIT (aún no redactado)">StGIT</a>. <sup class="reference" id="cite_ref-3" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Git#cite_note-3" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">3</a></sup> Sin embargo, Git se ha convertido desde entonces en un sistema de control de versiones con funcionalidad plena. <sup class="reference" id="cite_ref-4" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Git#cite_note-4" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">4</a></sup> Hay algunos proyectos de mucha relevancia que ya usan Git, en particular, el grupo de <a href="https://es.wikipedia.org/wiki/Programaci%C3%B3n" style="background: none; color: #0b0080; text-decoration: none;" title="Programación">programación</a> del <a href="https://es.wikipedia.org/wiki/N%C3%BAcleo_Linux" style="background: none; color: #0b0080; text-decoration: none;" title="Núcleo Linux">núcleo Linux</a>.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
El <a class="mw-redirect" href="https://es.wikipedia.org/wiki/Mantenimiento_de_Software" style="background: none; color: #0b0080; text-decoration: none;" title="Mantenimiento de Software">mantenimiento del software</a> Git está actualmente (2009) supervisado por Junio Hamano, quien recibe contribuciones al código de alrededor de 280 programadores.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
<br /></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiux501K-2YME5Zazm9ARSR5pW0afGM4iwgnpLMgTQWyERlIcC7K2vqT09w_z7IuhyphenhyphenZSNd9Pj_16hFBiH8gpe2r9daXbfuBkQqfdwJEBN5VR7JqW1aTQFQxXuTtHsmNea6RIgRnYaLwrWQ/s1600/repositorio-git1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiux501K-2YME5Zazm9ARSR5pW0afGM4iwgnpLMgTQWyERlIcC7K2vqT09w_z7IuhyphenhyphenZSNd9Pj_16hFBiH8gpe2r9daXbfuBkQqfdwJEBN5VR7JqW1aTQFQxXuTtHsmNea6RIgRnYaLwrWQ/s320/repositorio-git1.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Imagen de http://www.danielnavarroymas.com/</td></tr>
</tbody></table>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
Nuestra idea es crear un repositorio git en local y después poder acceder a él mediante el protocolo http/s (<a href="https://git-scm.com/docs/git-http-backend">git over http</a>) con validación en nuestro servidor LDAP. </div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
<br /></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
Así pues vamos paso a paso. Lo primero es crear un repositorio en local. Para ello creamos una carpeta y dentro de ella ejecutaremos git con el parámetro init:</div>
<br />
<br />
<br />
<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">root@eithel-server:/var/www/git# mkdir test.git<br />root@eithel-server:/var/www/git# cd test.git/<br />root@eithel-server:/var/www/git/test.git# <b><i>git init</i></b><br />Initialized empty Git repository in /var/www/git/test.git/.git/<br />root@samsagaz:/var/www/git/test.git# </span><br />
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
Vamos a ver como se ha inicializado nuestro directorio:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1RqbN537k2fpjJizgZstY56QrvF-m-skrtrpuYSPUiUSIpv1MfITcRJtF-8Ui3noSLar9YAgYXkLGw2deUFaBXIGM5MhEMmGJeSX9dzzfqLoUYBEih8rr8orO5bnLRPQRylIpcfDOZU/s1600/Captura+de+pantalla+de+2016-03-01+16-18-09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1RqbN537k2fpjJizgZstY56QrvF-m-skrtrpuYSPUiUSIpv1MfITcRJtF-8Ui3noSLar9YAgYXkLGw2deUFaBXIGM5MhEMmGJeSX9dzzfqLoUYBEih8rr8orO5bnLRPQRylIpcfDOZU/s400/Captura+de+pantalla+de+2016-03-01+16-18-09.png" width="317" /></a></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
<span style="line-height: 22.4px;">Pues muy bien, ya vemos que efectivamente tenemos una carpeta inicializada para poder trabajar con git. Así que hagamos un commit inicial para ver que tal:</span></div>
<span style="font-family: "courier new" , "courier" , monospace;">root@eithel:/var/www/git/test.git# git add .<br />root@eithel:/var/www/git/test.git# git commit -m 'initial commit'<br /># En la rama master<br />#<br /># Commit inicial<br />#<br />nada que hacer (crear/copiar archivos y utilice «git add» para continuar)</span><br />
<div style="background-color: white; margin-bottom: 0.5em; margin-top: 0.5em;">
Podemos hacer también <span style="font-family: "courier new" , "courier" , monospace;"><i>git status</i></span> para ver el estado del repositorio.</div>
<div style="background-color: white; margin-bottom: 0.5em; margin-top: 0.5em;">
Pues bien, ya tenemos repositorio funcionando. Ahora queremos acceder por http/s y queremos que nos pida el usuario para que se valide por LDAP. </div>
<div style="background-color: white; margin-bottom: 0.5em; margin-top: 0.5em;">
Vamos a suponer en este artículo que ya tenemos el servidor Apache instalado. Así pues, ahora lo que vamos ha hacer es configurar nuestro git.conf :</div>
<br />
<span style="font-family: courier new, courier, monospace;">SetEnv GIT_PROJECT_ROOT /var/www/git</span><br />
<span style="font-family: courier new, courier, monospace;">SetEnv GIT_HTTP_EXPORT_ALL</span><br />
<span style="font-family: courier new, courier, monospace;">SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER</span><br />
<span style="font-family: courier new, courier, monospace;">ScriptAlias /git/ /usr/lib/git-core/git-http-backend/</span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><Directory "/usr/lib/git-core*"></span><br />
<span style="font-family: courier new, courier, monospace;"> Options ExecCGI Indexes</span><br />
<span style="font-family: courier new, courier, monospace;"> Require all granted</span><br />
<span style="font-family: courier new, courier, monospace;"></Directory></span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><Directory /var/www/git></span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Options ExecCGI Indexes FollowSymLinks</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AllowOverride All</span><br />
<span style="font-family: courier new, courier, monospace;"> Require all granted</span><br />
<span style="font-family: courier new, courier, monospace;"></Directory></span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><Location /git/test.git/></span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>DAV on</span><br />
<span style="font-family: courier new, courier, monospace;">#<span class="Apple-tab-span" style="white-space: pre;"> </span>SSLRequireSSL</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Require all granted</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AuthName "GIT Repo"</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AuthType Basic</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AuthBasicProvider ldap</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AuthLDAPURL ldap://ldapserver:389/ou=People,dc=eithel?uid</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AuthLDAPGroupAttributeIsDN off</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AuthLDAPGroupAttribute memberUid</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>require user mi_usuario_LDAP</span><br />
<span style="font-family: courier new, courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#Satisfy any</span><br />
<span style="font-family: courier new, courier, monospace;"></Location></span><br />
<div>
<br /></div>
</div>
</div>
<span style="font-family: "courier new" , "courier" , monospace;"></span><br />
<div>
<br /></div>
<br />
Por otro lado nos tenemos que asegurar que los módulos de apache que necesitamos esten activos. Esto lo podemos saber haciendo:<span style="font-family: "courier new" , "courier" , monospace;">/usr/sbin/apache2ctl -t -D DUMP_MODULES</span><br />
<br />
Necesitaremos los módulos <i>authnz_ldap_module</i> y <i>ldap_module</i> para la validación con LDAP y los módulos <i>alias_module</i>, <i>env_module, dav_fs</i> y <i>cgi</i> para el funcionamiento del enlace apache-git.<br />
<br />
Si entramos en la carpeta del repositorio creado /var/www/git/test.git podemos ver que configuración tiene por defecto.<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">more config</span><br />
<br />
Si queremos modificar valores podemos usar el comando git con el parámetro config<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">git config --file config http.receivepack true</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">git config --bool core.bare true</span><br />
<br />
Por ejemplo podemos configurar el repositorio de esta manera (en este ejemplo dejaríamos modificar la rama principal):<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">[core]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>repositoryformatversion = 0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>filemode = true</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>bare = true</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>sharedrepository = 1</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[receive]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>denyNonFastforwards = true</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[http]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>receivepack = true</span><br />
<div>
<br /></div>
Configurar el servidor con las opciones que veais que más se ajustan a vuestras necesidades. Desde la parte cliente<br />
<br />
<br />
Entonces desde el ordenador cliente, por ejemplo, podemos hacer:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">cliente@mipc:/# <b>git push origin master</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Counting objects: 3, done.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Writing objects: 100% (3/3), 202 bytes | 0 bytes/s, done.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Total 3 (delta 0), reused 0 (delta 0)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">To http://ediaz@repository-eithel/git/test.git</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> * [new branch] master -> master</span><br />
<div>
<br /></div>
Como podéis comprobar, el usuario usa el <u>git sobre http</u> y el http el cual <u>se valida por LDAP</u>.<br />
<br />
Ahora según el uso que le vayáis a dar, es cuestión ya de ir configurando el respositorio y el cliente para, por ejemplo, excluir según que tipo de archivos del control de versiones mediante la creación del archivo .gitignore, etc.<br />
<div style="margin-bottom: 0.5em; margin-top: 0.5em;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-33888808588963719242016-02-18T07:30:00.000+01:002016-02-18T07:30:15.974+01:00Como solucionar problemas con ST8000AS0002-1NA17Z (8 Tb) en Linux (rsync, dd, cp...)<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWdRJboUYBUja8GMOdlYdFS-PqB4_Ehc6kZ4AI2Oo2U6cz5LIA5Anig9RIBK1xF6RpRqvC4lLzpFS4chfAyPCpqvF4uKy1ZO6xHgRwJEjU-Bh8X4NDaDmhRczl1KrWyd5eBGWVJ0Ys42Q/s1600/seagate8tb.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWdRJboUYBUja8GMOdlYdFS-PqB4_Ehc6kZ4AI2Oo2U6cz5LIA5Anig9RIBK1xF6RpRqvC4lLzpFS4chfAyPCpqvF4uKy1ZO6xHgRwJEjU-Bh8X4NDaDmhRczl1KrWyd5eBGWVJ0Ys42Q/s320/seagate8tb.jpg" width="218" /></a></div>
<br />
<div style="text-align: justify;">
Si nos hemos comprado el flamante disco duro de Seagate y probado en nuestro Ubuntu (o cualquier otra distribución), veremos que lo detecta sin problemas y que parece funcionar bien. Pero como los que compramos este tipo de discos es porque probablemente lo queremos para soluciones de respaldo (backup), sabremos que al hacer rsync, dd, cp o cualquier otra instrucción contra este disco, hace que el kernel de un error y se nos queda en modo lectura (read-only). Un ejemplo de lo que podemos ver en el syslog es este:</div>
<div style="text-align: justify;">
<br /></div>
<br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596415] ------------[ cut here ]------------</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596441] WARNING: CPU: 3 PID: 8153 at /build/linux-lts-vivid-whAhIw/linux-lts-vivid-3.19.0/fs/btrfs/super.c:260 __btrfs_abort_transaction+0x54/0x130 [btrfs]()</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596443] <b><i>BTRFS: Transaction aborted</i></b> (error -5)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596444] Modules linked in: nouveau mxm_wmi wmi video ttm drm_kms_helper drm snd_hda_codec_hdmi i2c_algo_bit intel_powerclamp snd_hda_codec_via snd_hda_codec_generic snd_hda_intel coretemp snd_hda_controller snd_hda_codec kvm_intel snd_hwdep kvm snd_pcm snd_timer snd soundcore serio_raw shpchp 8250_fintek lpc_ich asus_atk0110 mac_hid lp parport btrfs xor raid6_pq pata_acpi psmouse r8169 ahci libahci mii pata_via</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596462] CPU: 3 PID: 8153 Comm: kworker/u32:29 Tainted: G I 3.19.0-25-generic #26~14.04.1-Ubuntu</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596463] Hardware name: System manufacturer System Product Name/P7P55 LX, BIOS 1102 01/03/2011</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596475] Workqueue: btrfs-extent-refs btrfs_extent_refs_helper [btrfs]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596476] ffffffffc041ef40 ffff880002687c28 ffffffff817aed00 0000000000000000</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596478] ffff880002687c78 ffff880002687c68 ffffffff81074d8a 0000000102687c68</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596479] ffff880118f071e0 ffff8800d3c7b000 00000000fffffffb ffffffffc041b0b0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596481] Call Trace:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596489] [<ffffffff817aed00>] dump_stack+0x45/0x57</ffffffff817aed00></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596493] [<ffffffff81074d8a>] warn_slowpath_common+0x8a/0xc0</ffffffff81074d8a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596495] [<ffffffff81074e06>] warn_slowpath_fmt+0x46/0x50</ffffffff81074e06></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596501] [<ffffffffc036ef14>] __btrfs_abort_transaction+0x54/0x130 [btrfs]</ffffffffc036ef14></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596508] [<ffffffffc038bddc>] btrfs_run_delayed_refs.part.66+0x12c/0x2a0 [btrfs]</ffffffffc038bddc></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596516] [<ffffffffc038bff8>] delayed_ref_async_start+0x88/0xa0 [btrfs]</ffffffffc038bff8></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596527] [<ffffffffc03cd082>] normal_work_helper+0xc2/0x2b0 [btrfs]</ffffffffc03cd082></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596537] [<ffffffffc03cd4a2>] btrfs_extent_refs_helper+0x12/0x20 [btrfs]</ffffffffc03cd4a2></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596540] [<ffffffff8108db6f>] process_one_work+0x14f/0x400</ffffffff8108db6f></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596541] [<ffffffff8108e308>] worker_thread+0x118/0x510</ffffffff8108e308></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596543] [<ffffffff8108e1f0>] ? rescuer_thread+0x3d0/0x3d0</ffffffff8108e1f0></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596546] [<ffffffff81093802>] kthread+0xd2/0xf0</ffffffff81093802></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596548] [<ffffffff81093730>] ? kthread_create_on_node+0x1c0/0x1c0</ffffffff81093730></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596552] [<ffffffff817b65d8>] ret_from_fork+0x58/0x90</ffffffff817b65d8></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596553] [<ffffffff81093730>] ? kthread_create_on_node+0x1c0/0x1c0</ffffffff81093730></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596555] ---[ end trace ce5daf4bc8891b5b ]---</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596557] BTRFS: error (device sde1) in btrfs_run_delayed_refs:2792: errno=-5 IO failure</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Feb 10 08:57:59 eithel-server kernel: [149638.596680] <b><i>BTRFS info (device sde1): forced readonly</i></b></span><br />
<br />
En el ejemplo anterior vemos que he usado el sistema de archivos btrfs. Pues no os preocupeis, no es por el sistema de archivos. El mismo problema te dara cambiando las opciones de montaje del btrfs o probándolo con cualquier otro sistema de archivos ( ext2/3/4, jfs, zfs, xfs, ... ) a excepción de NTFS. Con NTFS no pasa. Podeis hacer vuestras pruebas y con casi total seguridad llegaréis a la misma conclusión.<br />
<br />
Y.. ¿ahora que? Bueno, la clave esta en saber que el problema es de nuestro kernel. Así que actualizamos nuestro ubuntu 15.10 (wily) desde el repositorio para ver si lo arregla y seguimos sin arreglarlo:<br />
<br />
<i>Linux MiMaquina <b>4.2.0-27-generic</b> #32-Ubuntu SMP Fri Jan 22 04:49:08 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux</i><br />
<br />
Entonces ya podemos empezar a caer en la desesperación. Pero aun no esta todo perdido. Podemos mirar de ir más allá del kernel oficial de nuestro repositorio y bajarnos una actualización mayor. Para ello seguiremos el artículo ya publicado:<br />
<ul style="text-align: left;">
<li><a href="http://eithel-inside.blogspot.com.es/2016/02/actualizar-kernel-de-ubuntu-44-desde.html">Actualizar kernel de Ubuntu a 4.4.* desde paquetes</a></li>
</ul>
Una vez actualizado el sistema veremos que ya todos nuestros problemas han acabado y que el disco no se pone en sólo lectura al hacer rsync, dd o cp de gran cantidad de archivos.<br />
<br />
Si queremos estar seguros de nuestro modelo de disco duro podemos utilizar los parámetros de hdparm según el artículo publicado anteriormente:<br />
<ul style="text-align: left;">
<li><a href="http://eithel-inside.blogspot.com.es/2016/02/hdparm-parametrizar-tu-disco-duro.html">hdparm: Parametrizar tu disco duro</a></li>
</ul>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-48291647038569384092016-02-17T10:29:00.001+01:002016-02-17T10:29:07.006+01:00Actualizar kernel de Ubuntu a 4.4.* desde paquetes<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9C0BQpfSPWaU1RLrC9PY38SztjgTSMViuottCLd3KxfJ3o5auRhDW6spw1ZB-bCsCRCmihYvC7Aw5uTzEtU-6-cBVJf3cMBz0GeYlgM3Eb3kCXgxxw-BJDaNM1sk7gJM38SIsHiMRUUY/s1600/Linux3.10.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9C0BQpfSPWaU1RLrC9PY38SztjgTSMViuottCLd3KxfJ3o5auRhDW6spw1ZB-bCsCRCmihYvC7Aw5uTzEtU-6-cBVJf3cMBz0GeYlgM3Eb3kCXgxxw-BJDaNM1sk7gJM38SIsHiMRUUY/s320/Linux3.10.png" width="320" /></a></div>
<br />
<div style="text-align: justify;">
Si queremos estar a la última con nuestro kernel tenemos siempre la opción de <a href="https://www.kernel.org/">descargarnos las fuentes</a> y compilar el último. Pero esta tarea siempre puede ser trabajosa y necesitamos una solución más rápida. Para ello tenemos kernel.ubuntu.com que nos proporciona los últimos kernels en versión .deb para que los podamos instalar para nuestra distribución sin problemas. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Yo os aconsejo mirar <a href="http://kernel.ubuntu.com/~kernel-ppa/mainline/">http://kernel.ubuntu.com/~kernel-ppa/mainline/</a> y comprobar cual es la ultima versión disponible (stable). A la hora de redactar este artículo la última versión era la 4.4.1 . Adaptarla a vuestras necesidades. </div>
<br />
<br />
<br />
¿Como procedo? Primero nos descargamos los paquetes necesarios:<br />
<br />
<br />
<b><u><span style="font-size: large;">Versión 64bits:</span></u></b><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$ cd /tmp<br />$ wget \<br />kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.1-wily/linux-headers-4.4.1-040401_4.4.1-040401.201601311534_all.deb \<br />kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.1-wily/linux-headers-4.4.1-040401-generic_4.4.1-040401.201601311534_amd64.deb \<br />kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.1-wily/linux-image-4.4.1-040401-generic_4.4.1-040401.201601311534_amd64.deb</span><br /><b><u><span style="font-size: large;">Versión 32bits:</span></u></b><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$ cd /tmp<br />$ wget \<br />kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.1-wily/linux-headers-4.4.1-040401_4.4.1-040401.201601311534_all.deb \<br />kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.1-wily/linux-headers-4.4.1-040401-generic_4.4.1-040401.201601311534_i386.deb \<br />kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.1-wily/linux-image-4.4.1-040401-generic_4.4.1-040401.201601311534_i386.deb</span><br />
<br />
<br />
Luego simplemente instalamos estos paquetes:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo dpkg -i linux-headers-4.4*.deb linux-image-4.4*.deb</span><br />
<br />
Si por cualquier razón decidieramos desinstalar el kernel, se hace comúnmente con el comando apt-get remove:<br />
<br /><span style="font-family: Courier New, Courier, monospace;">$ sudo apt-get remove linux-headers-4.4* linux-image-4.4*</span><br /><br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-3496480808779625632016-02-11T17:00:00.000+01:002016-02-15T12:31:21.115+01:00Nombres de Interfaz de Red Predictivos (cambios de eth0 a enp2s0, etc)<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
<b>systemd</b> es un conjunto de <a href="https://es.wikipedia.org/wiki/Demonio_(inform%C3%A1tica)" style="background: none; color: #0b0080; text-decoration: none;" title="Demonio (informática)">demonios o <i>daemons</i></a> de administración de sistema, <a href="https://es.wikipedia.org/wiki/Biblioteca_(inform%C3%A1tica)" style="background: none; color: #0b0080; text-decoration: none;" title="Biblioteca (informática)">bibliotecas</a> y herramientas diseñados como una plataforma de administración y configuración central para interactuar con el <a href="https://es.wikipedia.org/wiki/N%C3%BAcleo_(inform%C3%A1tica)" style="background: none; color: #0b0080; text-decoration: none;" title="Núcleo (informática)">núcleo</a> del <a href="https://es.wikipedia.org/wiki/Sistema_operativo" style="background: none; color: #0b0080; text-decoration: none;" title="Sistema operativo">Sistema operativo</a><a href="https://es.wikipedia.org/wiki/GNU/Linux" style="background: none; color: #0b0080; text-decoration: none;" title="GNU/Linux">GNU/Linux</a>. Descrito por sus autores como un "bloque de construcción básico" para un sistema operativo,<sup class="reference" id="cite_ref-kongress_4-0" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Systemd#cite_note-kongress-4" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">4</a></sup> systemd se puede utilizar como un sistema de inicio de Linux (el proceso <a href="https://es.wikipedia.org/wiki/Init" style="background: none; color: #0b0080; text-decoration: none;" title="Init">init</a> llamado por el <a href="https://es.wikipedia.org/wiki/N%C3%BAcleo_Linux" style="background: none; color: #0b0080; text-decoration: none;" title="Núcleo Linux">núcleo o <i>kernel</i> de Linux</a> para inicializar el espacio de usuario durante el proceso de arranque de Linux y gestionar posteriormente todos los demás procesos). El nombre systemd se adhiere a la convención Unix de distinguir los demonios fácilmente por tener la letra d como la última letra del nombre de archivo.<sup class="reference" id="cite_ref-control-center_5-0" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Systemd#cite_note-control-center-5" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">5</a></sup></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
Se desarrolló systemd para reemplazar el sistema de inicio (<a href="https://es.wikipedia.org/wiki/Init" style="background: none; color: #0b0080; text-decoration: none;" title="Init">init</a>) heredado de los sistemas operativos estilo UNIX<a href="https://es.wikipedia.org/wiki/System_V" style="background: none; color: #0b0080; text-decoration: none;" title="System V">System V</a> y <a href="https://es.wikipedia.org/wiki/Berkeley_Software_Distribution" style="background: none; color: #0b0080; text-decoration: none;" title="Berkeley Software Distribution">Berkeley Software Distribution</a> (BSD). En el <a href="https://es.wikipedia.org/wiki/Proceso_de_arranque_en_Linux" style="background: none; color: #0b0080; text-decoration: none;" title="Proceso de arranque en Linux">proceso de arranque en Linux</a>, es el primer <a href="https://es.wikipedia.org/wiki/Proceso_(inform%C3%A1tica)" style="background: none; color: #0b0080; text-decoration: none;" title="Proceso (informática)">proceso</a> que se ejecuta en el <a href="https://es.wikipedia.org/wiki/Espacio_de_usuario" style="background: none; color: #0b0080; text-decoration: none;" title="Espacio de usuario">espacio de usuario</a>, por lo tanto, también es el proceso padre de todos los procesos hijos en el espacio de usuario. systemd se diseñó para el núcleo de Linux y programado exclusivamente para la API de Linux. Escrito por<a href="https://es.wikipedia.org/wiki/Lennart_Poettering" style="background: none; color: #0b0080; text-decoration: none;" title="Lennart Poettering">Lennart Poettering</a><sup class="reference" id="cite_ref-faqs_1-1" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Systemd#cite_note-faqs-1" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">1</a></sup> y se publica como <a href="https://es.wikipedia.org/wiki/Software_libre_y_de_c%C3%B3digo_abierto" style="background: none; color: #0b0080; text-decoration: none;" title="Software libre y de código abierto">Software_libre_y_de_código_abierto</a> bajo los términos de la<a href="https://es.wikipedia.org/wiki/GNU_General_Public_License" style="background: none; color: #0b0080; text-decoration: none;" title="GNU General Public License">GNU_General_Public_License</a> (LGPL) versión 2.1 o posterior.<sup class="reference" id="cite_ref-note-license_6-0" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Systemd#cite_note-note-license-6" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">6</a></sup> Uno de los principales objetivos de systemd es unificar configuraciones básicas de Linux y los comportamientos de servicios en todas las distribuciones.<sup class="reference" id="cite_ref-alldistros_7-0" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Systemd#cite_note-alldistros-7" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">7</a></sup></div>
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Systemd">Wikipedia</a>)</span><br />
<br />
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKeJIGXzbcyW1ZfIT7cuwqotERqVBOfSovPD4JEcKC-u3TAiDLYUP2Ju24Mwb91rJa-1AEc6_mOgRn8psPO-EpFBhFlqYuewM-ZZJ1Gc9i5PB5hzZPRG8LjeNshA9rNbKHbkzpcRCtx44/s1600/Free_and_open-source-software_display_servers_and_UI_toolkits.svg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="291" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKeJIGXzbcyW1ZfIT7cuwqotERqVBOfSovPD4JEcKC-u3TAiDLYUP2Ju24Mwb91rJa-1AEc6_mOgRn8psPO-EpFBhFlqYuewM-ZZJ1Gc9i5PB5hzZPRG8LjeNshA9rNbKHbkzpcRCtx44/s640/Free_and_open-source-software_display_servers_and_UI_toolkits.svg.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: xx-small;">(Fuente <a href="https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/">freedesktop.org</a>)</span><br />
<br />
<div>
<br /></div>
<div>
¿Y que tiene que ver todo esto con que ahora mi interfaz de red se llame <b>enp2s0</b> o enx78e7d1ea46da en vez de <b>eth0</b>? Pues bien, todo esto es a causa de la nueva versión de systemd. Una modificación en este gestor de demonios que afecta a partir de la versión 197. A partir de dicha versión, systemd/udev asigna automáticamente los nombres de interfaz de red para Ethernet, WLAN y WWAN. Desde esta modificación se ha optado por una nomenclatura segun las características físicas (hardware):</div>
<br />
1. Nombres que incorporan información del Firmware o BIOS del hardware (ejemplo:ENO1).<br />
2. Nombres que incorporan información del Firmware o BIOS que proporciona el slot PCI Express (ejemplo: ens1)<br />
3. Nombres que incorporan ubicación física del conector (ejemplo: enp2s0)<br />
4. Nombres que incorporan la dirección MAC de las interfaces (ejemplo:enx78f8d1ea46da)<br />
5. El estilo clásico del kernel (ejemplo: eth1)<br />
<span style="font-size: xx-small;">(Fuente <a href="http://dplinux.net/por-que-han-cambiado-el-nombre-de-las-interfaces-de-red/">detrás del pingüíno</a> y <a href="https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/">freedesktop.org</a>)</span><br />
<br />
Sabiendo esta información, vamos a dejar de quejarnos del cambio de nombre (porque despues de tantos años es un cambio al que seguro somos algo reacios) y vamos a empezar a 'jugar'. Vamos a averiguar que entiende udev de nuestro dispositivo de red (por ejemplo, eth0):<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">eithel@inside:~$ udevadm info -e | grep -A 9 ^P.*eth0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">P: /devices/pci0000:00/0000:00:1c.2/0000:04:00.0/net/eth0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: DEVPATH=/devices/pci0000:00/0000:00:1c.2/0000:04:00.0/net/eth0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_BUS=pci</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_MM_CANDIDATE=1</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_MODEL_FROM_DATABASE=RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (P8P67 and other motherboards)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_MODEL_ID=0x8168</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_NET_DRIVER=r8169</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_NET_LINK_FILE=/lib/systemd/network/99-default.link</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_NET_NAME=enp4s0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">E: ID_NET_NAME_MAC=enxf46d04ae330e</span><br />
<div>
<br /></div>
Segun esta lectura, mi eth0 con la nueva nomenclatura se llamaría enp4s0.<br />
<br />
Vale.... pero esto de que es predictivo.... ¿Por que? . Bueno, porque ahora tenemos que entender que significa el nombre que le ha dado. Esto lo podemos ver en las fuentes <a href="https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c" style="background-color: white; border-bottom-color: rgb(42, 138, 21); border-bottom-style: dotted; border-bottom-width: 1px; box-sizing: border-box; color: #2a8a15; font-family: 'Roboto Slab', serif; font-size: 16px; line-height: 26px; outline: 0px; text-decoration: none; transition: all 0.1s ease-in-out;">src/udev/udev-builtin-net_id.c</a><br />
en donde veremos que significa cada cosa:<br />
<br />
<pre class="c" style="background-attachment: initial !important; background-clip: initial !important; background-image: initial !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: none !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; box-sizing: border-box; clear: none !important; color: #110000; font-size: 12px !important; line-height: 16px !important; overflow: visible !important; padding: 0px 4px !important; width: auto !important;"><span style="box-sizing: border-box; color: grey; font-style: italic;">/*
* Predictable network interface device names based on:
* - firmware/bios-provided index numbers for on-board devices
* - firmware-provided pci-express hotplug slot index number
* - physical/geographical location of the hardware
* - the interface's MAC address
*
* http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames
*
* Two character prefixes based on the type of interface:
* en -- ethernet
* sl -- serial line IP (slip)
* wl -- wlan
* ww -- wwan
*
* Type of names:
* b<number> -- BCMA bus core number
* ccw<name> -- CCW bus group name
* o<index>[d<dev_port>] -- on-board device index number
* s<slot>[f<function>][d<dev_port>] -- hotplug slot index number
* x<mac> -- MAC address
* [P<domain>]p<bus>s<slot>[f<function>][d<dev_port>]
* -- PCI geographical location
* [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
* -- USB port number chain</interface></config></port></function></slot></bus></domain></dev_port></function></slot></bus></domain></mac></dev_port></function></slot></dev_port></index></name></number></span></pre>
<b><u></u></b><br />
<div>
<br /></div>
Entonces ahora sabemos que si mi eth0 se llama ahora enp4s0 es porque es un ethernet, en el bus 4 y slot 0.<br />
<br />
Podemos comprobar mediante lspci que efectivamente alli tengo una tarjeta de red:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>lspci -s 04:00</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;">04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)</span><br />
<br />
<i><span style="font-size: x-small;">*He buscado 04:00 ya que la salida de udevadm de más arriba, en la linea que empezaba por P: así me indicaba donde encontrarlo.</span></i><br />
<br />
Bueeeno, pues ahora ya esta. Ya se como funciona. Pero puedo decidir no usar la nueva nomenclatura. ¿Puedo cambiarlo? . La respuesta es, como casi todo en GNU/Linux, que si. Vamos a ver como :<br />
<br />
<b>1.-</b> Deshabilitando el enlace de asignaciones a nombres fijos:<br />
ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules<br />
<br />
<b>2.-</b> Crearse tu propio esquema de nombrado. Esto lo haremos un archivo .link en /etc/systemd/network . Para ello mirad<span style="background-color: white; font-size: 16.16px;"> </span><a href="http://www.freedesktop.org/software/systemd/man/systemd.link.html" style="background-color: white; color: #52188b; font-size: 16.16px;">systemd.link(5)</a><br />
<br />
<b>3.-</b> Decirle al kernel que no lo use mediante el parámetro net.ifnames=0 en /etc/default/grub:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"</span><br />
<div>
<br />
y luego actualizar grub mediante <b>sudo update-grub</b><br />
<br />
Espero que os haya ayudado a entender el porqué del cambio, como aprovecharse de las nuevas funcionabilidades y, en caso de que no estemos agusto o por compatibilidades de scripts, etc no podamos usarlo, como deshabilitarlo.<br />
<br />
<br />
<b><u>Enlaces de interes</u></b><br />
<br />
<ul style="text-align: left;">
<li>https://www.freedesktop.org/wiki/Software/systemd/</li>
<li>https://es.wikipedia.org/wiki/Freedesktop.org</li>
</ul>
<div>
<b><br /></b></div>
</div>
<b>Algunos ejemplos (en ingles)</b><br />
<b><br /></b>
<div class="variablelist" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 13px;">
<dl class="variablelist">
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">em</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">N</code></em></span></dt>
<dd>Ethernet interface on the motherboard, where <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">N</code></em> is the number of the interface starting from 1.</dd>
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">p</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">S</code></em><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">p</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">P</code></em></span></dt>
<dd>Network interface on a PCI card, where <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">S</code></em> is the slot number and <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">P</code></em> is the port number.</dd>
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">p</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">S</code></em><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">p</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">P</code></em><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">_</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">V</code></em></span></dt>
<dd>Virtual interface, where <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">S</code></em> is the slot number, <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">P</code></em> is the port number, and <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">V</code></em> is the virtual interface number.</dd></dl>
</div>
<div style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 13px;">
If <code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px;">biosdevname</code> is set to 0 (the default), <code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px;">systemd</code> naming assigns the prefixes, <code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px;">en</code>, <code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px;">wl</code>, and <code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px;">ww</code> to Ethernet, wireless LAN, and wireless WAN interfaces respectively. The prefix is followed by a suffix based on the hardware configuration, system bus configuration, or MAC address of the device:</div>
<div class="variablelist" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 13px;">
<dl class="variablelist">
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">o</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">N</code></em></span></dt>
<dd>Onboard device with index number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">N</code></em>.</dd>
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">p</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">B</code></em><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">s</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">S</code></em>[<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">f</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">F</code></em>][<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">d</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">D</code></em>]</span></dt>
<dd>PCI device with bus number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">B</code></em>, slot number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">S</code></em>, function number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">F</code></em>, and device ID <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">D</code></em>.</dd>
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">p</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">B</code></em><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">s</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">S</code></em>[<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">f</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">F</code></em>][<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">u</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">P</code></em>]...[<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">c</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">C</code></em>][<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">i</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">I</code></em>]</span></dt>
<dd>USB device with bus number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">B</code></em>, slot number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">S</code></em>, function number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">F</code></em>, port number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">P</code></em>, configuration number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">C</code></em>, and interface number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">I</code></em>.</dd>
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">s</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">S</code></em>[<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">f</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">F</code></em>][<code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">d</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">D</code></em>]</span></dt>
<dd>Hot-plug device with slot number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">S</code></em>, function number <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">F</code></em>, and device ID <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">D</code></em>.</dd>
<dt><span class="term" style="font-weight: bold;"><code class="literal" style="font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: normal;">x</code><em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; padding: 1px;">M</code></em></span></dt>
<dd>Device with MAC address <em class="replaceable"><code style="background-color: inherit; color: inherit; font-family: 'Courier New', Courier, fixed, monospace; font-size: 12.35px; font-weight: bold; padding: 1px;">M</code></em>.</dd></dl>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-69695898584172430342016-02-08T12:31:00.002+01:002016-02-08T12:31:57.348+01:00hdparm: Parametrizar tu disco duro<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoalCZ_sXMYD4AKTTgb2f7CAjfLVUUYX30DC0GxauH-ZntJ_4Gw1owc5GExKMFM3MK3ylJQEdxhZZkY1-A81dOgIG2xdmPE59-riFLyF8sZMOTTENwGvypJ3SHONlj7i4sWsEdcUeJj_w/s1600/HDD_Diagram.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoalCZ_sXMYD4AKTTgb2f7CAjfLVUUYX30DC0GxauH-ZntJ_4Gw1owc5GExKMFM3MK3ylJQEdxhZZkY1-A81dOgIG2xdmPE59-riFLyF8sZMOTTENwGvypJ3SHONlj7i4sWsEdcUeJj_w/s320/HDD_Diagram.png" width="320" /></a></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
<b>hdparm</b> es una utilidad de <a class="mw-redirect" href="https://es.wikipedia.org/wiki/L%C3%ADnea_de_comandos" style="background: none; color: #0b0080; text-decoration: none;" title="Línea de comandos">línea de comandos</a> de los sistemas operativos <a href="https://es.wikipedia.org/wiki/GNU/Linux" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="GNU/Linux">GNU/Linux</a><span style="line-height: 22.4px;"> </span><span style="line-height: 22.4px;">y</span><span style="line-height: 22.4px;"> </span><a class="mw-redirect" href="https://es.wikipedia.org/wiki/Windows" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="Windows">Windows</a><span style="line-height: 22.4px;"> </span><span style="line-height: 22.4px;">para ver y ajustar los parámetros del</span><span style="line-height: 22.4px;"> </span><a href="https://es.wikipedia.org/wiki/Hardware" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="Hardware">hardware</a><span style="line-height: 22.4px;"> </span><span style="line-height: 22.4px;">de los discos</span><span style="line-height: 22.4px;"> </span><a href="https://es.wikipedia.org/wiki/Integrated_Drive_Electronics" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="Integrated Drive Electronics">IDE</a><span style="line-height: 22.4px;"> </span><span style="line-height: 22.4px;">y</span><a class="mw-redirect" href="https://es.wikipedia.org/wiki/SATA" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="SATA">SATA</a><sup class="reference" id="cite_ref-1" style="line-height: 1em; unicode-bidi: isolate;"><a href="https://es.wikipedia.org/wiki/Hdparm#cite_note-1" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">1</a></sup><span style="line-height: 22.4px;"> </span><span style="line-height: 22.4px;">(aunque estos últimos cuentan también con una utilidad específica llamada</span><span style="line-height: 22.4px;"> </span><a class="new" href="https://es.wikipedia.org/w/index.php?title=Sdparm&action=edit&redlink=1" style="background: none; color: #a55858; line-height: 22.4px; text-decoration: none;" title="Sdparm (aún no redactado)">sdparm</a><span style="line-height: 22.4px;">). La utilidad puede ajustar parámetros como el</span><span style="line-height: 22.4px;"> </span><a href="https://es.wikipedia.org/wiki/Cach%C3%A9_de_disco" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="Caché de disco">caché de disco</a><span style="line-height: 22.4px;">, el modo de descanso, el control de energía, la gestión acústica y los ajustes</span><span style="line-height: 22.4px;"> </span><a class="mw-redirect" href="https://es.wikipedia.org/wiki/DMA" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="DMA">DMA</a><span style="line-height: 22.4px;">. Suele venir instalado por defecto en la mayoría de distribuciones</span><span style="line-height: 22.4px;"> </span><a href="https://es.wikipedia.org/wiki/GNU/Linux" style="background: none; color: #0b0080; line-height: 22.4px; text-decoration: none;" title="GNU/Linux">GNU/Linux</a><span style="line-height: 22.4px;">.</span></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
Cambiar los parámetros de los valores conservativos por defecto a los ajustes óptimos puede aumentar el rendimiento sustancialmente. Por ejemplo, activar el modo<a class="mw-redirect" href="https://es.wikipedia.org/wiki/DMA" style="background: none; color: #0b0080; text-decoration: none;" title="DMA">DMA</a> puede hacer que en ocasiones se doble o se triplique la velocidad de transferencia de datos. Desgraciadamente no hay un método confiable para determinar los ajustes óptimos para la combinación de una controladora determinada, excepto el método de prueba y error; además, todavía no hay una base de datos central que recolecte y comparta la experiencia de los usuarios de hdparm.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
<b><i>hdparm tiene un serio inconveniente: <u>puede bloquear el sistema y hacer los datos del disco duro inaccesibles</u> si se usan inadecuadamente ciertos parámetros.</i></b> De aproximadamente unos cuarenta parámetros disponibles, siete son potencialmente peligrosos y pueden ocasionar una <i>corrupción masiva del sistema de ficheros</i>.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; line-height: 22.4px; margin-bottom: 0.5em; margin-top: 0.5em;">
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Hdparm">Wikipedia</a>)</span></div>
<br />¿Para que podemos querere configurar nuestro disco duro? ¿No es ya suficiente que este funcionando y sin errores?. La respuesta es casi siempre que si. Podemos dejarlo por defecto y en la mayoría de los casos no vamos a quejarnos.... seguramente por desconocimiento. ¿Hace falta engrasar y cuidar la cadena de una bicicleta? Bien.. si vamos solo de vez en cuando con ella, quizas no nos interesa sacarle un buen rendimiento. Pero si lo que queremos es más velocidad, más rendimiento.. entonces nos interesa dar un pasito más y configurarlo. Podemos ganar velocidad de escritura/lectura o incluso ahorrar energia y alargar la vida de nuestro disco. Eso si, hdparm trabaja a un nivel muy bajo, y si lo configuramos mal podemos dejar nuestro disco duro inaccesible. <div>
Esta guía esta realizada bajo mi experiencia pero <b>no me responsabilizo de daños ocasionados por su uso</b>. <div>
<br />Podemos instalar hdparm facilmente desde nuestro repositorio oficial (apt-get install hdparm). </div>
<div>
Para los ejemplos usaremos el dispositivo <b>/dev/sda</b> . Vosotros cambiarlo por el que queráis optimizar.<br /><div>
<br /><br />Primeramente vamos a mirar como está funcionando nuestro disco:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b><i>hdparm /dev/sda</i></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sda:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> multcount = 0 (off)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> IO_support = 1 (32-bit)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> readonly = 0 (off)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> readahead = 256 (on)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> geometry = 486401/255/63, sectors = 7814037168, start = 0</span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Para sacar toda la información completa y detallada del disco:<div>
<br /></div>
<div>
<b><i>hdparm -I /dev/sda</i></b></div>
<br />
<br />
Significado de algunas de estas variables:<div>
<ul style="text-align: left;">
<li>multicount: Nº de sectores que se leen en cada acceso.</li>
<li>IO_support: 16/32 bits.</li>
<li>unmakirq: Desemascarar IRQ del disco. Permite “compartir” la IRQ.</li>
<li>using_dma: Acceso directo a memoria.</li>
</ul>
</div>
<div>
<br /></div>
<div>
<br /></div>
<b>DMA</b><br />
Mediante este comando podremos saber si nuestro disco tiene UDMA activado (activado por defecto desde Ubuntu 6.06)<br />
<br />
* soporte DMA:<br />
<span style="font-family: Courier New, Courier, monospace;">sudo hdparm -I /dev/sda |grep ‘DMA:’</span><br />
<br />
por ejemplo:<br />
<span style="font-family: Courier New, Courier, monospace;">DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6</span><br />
<div>
<i>(El tipo de DMA que vemos con un asterisco es el que se activa en el arranque del sistema)</i></div>
<br />
<br />
También podemos hacerlo mediante:<br />
hdparm -d /dev/sda</div>
<div>
<br /></div>
<div>
<br /><br />
Tenemos esta tabla para saber que significa en métrica cada tipo de DMA y PIO:<br />
<table class="wikitable" style="background-color: #f9f9f9; border-collapse: collapse; border: 1px solid rgb(170, 170, 170); color: black; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin: 1em 0px; text-align: center;"><caption style="font-weight: bold;">Transfer Modes</caption><tbody>
<tr><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Number</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Also called</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Maximum transfer<div>
rate (MB/s)</div>
</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Defining standard</th></tr>
<tr><td rowspan="8" style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Ultra DMA</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">0</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">16.7</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/ATA-4" style="background: none; color: #0b0080; text-decoration: none;" title="ATA-4">ATA-4</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">1</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">25.0</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/ATA-4" style="background: none; color: #0b0080; text-decoration: none;" title="ATA-4">ATA-4</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">2</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Ultra ATA/33</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">33.3</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/ATA-4" style="background: none; color: #0b0080; text-decoration: none;" title="ATA-4">ATA-4</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">3</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">44.4</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/ATA-5" style="background: none; color: #0b0080; text-decoration: none;" title="ATA-5">ATA-5</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">4</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Ultra ATA/66</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">66.7</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/ATA-5" style="background: none; color: #0b0080; text-decoration: none;" title="ATA-5">ATA-5</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">5</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Ultra ATA/100</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">100</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/ATA-6" style="background: none; color: #0b0080; text-decoration: none;" title="ATA-6">ATA-6</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">6</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Ultra ATA/133</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">133</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/ATA-7" style="background: none; color: #0b0080; text-decoration: none;" title="ATA-7">ATA-7</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">7</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Ultra ATA/167</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">167</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a href="https://en.wikipedia.org/wiki/CompactFlash" style="background: none; color: #0b0080; text-decoration: none;" title="CompactFlash">CompactFlash</a> 6.0<sup class="reference" id="cite_ref-1" style="font-size: 11.2px; line-height: 1; unicode-bidi: isolate;"><a href="https://en.wikipedia.org/wiki/UDMA#cite_note-1" style="background: none; color: #0b0080; text-decoration: none; white-space: nowrap;">[1]</a></sup></td></tr>
</tbody></table>
<span style="font-size: xx-small;">(Fuente <a href="https://en.wikipedia.org/wiki/UDMA">Wikipedia</a>)</span><br />
<br />
<table class="wikitable" style="background-color: #f9f9f9; border-collapse: collapse; border: 1px solid rgb(170, 170, 170); color: black; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin: 1em 0px; text-align: center;"><caption style="font-weight: bold;">PIO modes</caption><tbody>
<tr><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Maximum transfer rate (MB/s)</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Minimum cycle time</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Standard where spec is defined</th></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode 0</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">3.3</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">600 <a class="mw-redirect" href="https://en.wikipedia.org/wiki/1_E-9_s" style="background: none; color: #0b0080; text-decoration: none;" title="1 E-9 s">ns</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/AT_Attachment#ATA_standards_versions.2C_transfer_rates.2C_and_features" style="background: none; color: #0b0080; text-decoration: none;" title="AT Attachment">ATA-1</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode 1</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">5.2</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">383 <a class="mw-redirect" href="https://en.wikipedia.org/wiki/1_E-9_s" style="background: none; color: #0b0080; text-decoration: none;" title="1 E-9 s">ns</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">ATA-1</td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode 2</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">8.3</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">240 <a class="mw-redirect" href="https://en.wikipedia.org/wiki/1_E-9_s" style="background: none; color: #0b0080; text-decoration: none;" title="1 E-9 s">ns</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">ATA-1</td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode 3</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">11.1</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">180 <a class="mw-redirect" href="https://en.wikipedia.org/wiki/1_E-9_s" style="background: none; color: #0b0080; text-decoration: none;" title="1 E-9 s">ns</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">ATA-2</td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode 4</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">16.7</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">120 <a class="mw-redirect" href="https://en.wikipedia.org/wiki/1_E-9_s" style="background: none; color: #0b0080; text-decoration: none;" title="1 E-9 s">ns</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">ATA-2</td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode 5</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">20</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">100 <a class="mw-redirect" href="https://en.wikipedia.org/wiki/1_E-9_s" style="background: none; color: #0b0080; text-decoration: none;" title="1 E-9 s">ns</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a href="https://en.wikipedia.org/wiki/CompactFlash" style="background: none; color: #0b0080; text-decoration: none;" title="CompactFlash">CompactFlash</a> 2.0</td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">Mode 6</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">25</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">80 <a class="mw-redirect" href="https://en.wikipedia.org/wiki/1_E-9_s" style="background: none; color: #0b0080; text-decoration: none;" title="1 E-9 s">ns</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">CompactFlash 2.0<div>
<br /></div>
<div>
<br /></div>
</td></tr>
</tbody></table>
<span style="font-size: xx-small;">(Fuente <a href="https://en.wikipedia.org/wiki/Programmed_input/output">Wikipedia</a>)</span><br />
<br />
<br />
<b>VELOCIDAD</b><br />
Ahora vamos a mirar el caso de que queramos incrementar la velocidad de lectura/escritura. Veremos en la información extraída con el parámetro '-I' una linea que habla de R/W multiple sector transfer. Bien, pues esta linea nos va a dar la pista de si podemos o no incrementar la velocidad de nuestro disco.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">R/W multiple sector transfer: Max = 16<span class="Apple-tab-span" style="white-space: pre;"> </span>Current = ?</span><br />
<br />
Si queremos poner la transferencia multiple de sectores al máximo, en el ejemplo anterior nos fijamos en el valor 'Max' y hacemos lo siguiente:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>hdparm -m16 /dev/sda</b></span><br />
<br />
(hemos puesto 16 dado que es el valor Máximo segun la especificacion de nuestro dispositivo).<br />
<br />
<b>hdparm.conf</b><br />
En /etc/hdparm.conf podemos configurar como queremos que funcionen nuestros discos en el arranque. Por defecto en Ubuntu viene todo comentado excepto la linea 'quiet'. Así pues, lo que nos quiere decir esto es que ubuntu tiene unas opciones ya por defecto y aquí es donde las podemos cambiar si deseamos un comportamiento diferente. Leerse el archivo este es lo más similar a hacer <b><i>man hdparm</i></b>.<br />
<br />
<b>AHORRO DE ENERGIA Y VIDA DEL DISCO</b><br />
Los fabricantes de disco suelen especificar cuantas veces un disco duro puede ser apagado y encendido durante su vida util. Unas 200.000 veces, por decir un estandard. Eso significa que si lo encendemos y apagamos unas 200.000 veces.. podremos agotar su vida util. 200.000 veces, con una vida de disco duro de 5 años, significaría 40.000 apagadas y encendidas por año, osea unas 109 veces en un dia. Ten en cuenta estos cálculos para saber si el apagado/encendido te sale a cuenta.<br />
<br />
Si decidimos que SI sale a cuenta, podemos especificar un tiempo de inactividad minimo para que se apagen automáticamente. Por ejemplo:<br />
<br />sudo hdparm -S 24 /dev/sda<br /></div>
<div>
El disco se apagará después de 24*5=120 segundos de inactividad<br /><br /><b><span style="font-family: Courier New, Courier, monospace;">sudo hdparm -Y /dev/sda</span></b></div>
<div>
<br /></div>
<div>
El disco entrará en apagado inmediátamente, causando el apagado del disco. Se necesita un reset por software o hardware para iniciarlo de nuevo. El driver IDE de Linux lo hará si se necesita de forma automática.<br /><br /><div>
<span style="font-family: Courier New, Courier, monospace;"><b>hdparm -Y /dev/sda1</b></span></div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sda1:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> issuing sleep command</span></div>
<div>
<br /></div>
Ahora seguramente querremos comprobar que estamos en 'Sleep Mode'. Haremos lo siguiente para comprobarlo:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">hdparm -C /dev/sda</span><span style="font-family: Courier New, Courier, monospace;">/dev/sdb1:</span><br />
<span style="font-family: Courier New, Courier, monospace;"> drive state is: standby</span><br />
<div>
<br /></div>
<div>
Pero tambien hay casos en el que hacer esta prueba justamente lo que hace es levantarnos el disco y sacarnos del modo de apagado. Básicamente al conectar con él para ver su estado, lo sacamos de su letargo. Para comprobarlo podemos mirar el <span style="font-family: Courier New, Courier, monospace;">/var/log/syslog</span> y si una vez lo teníamos en sleeping mode, lo levantamos y vemos algo como <span style="font-family: Courier New, Courier, monospace;">"ata3.00: waking up from sleep"</span> significará que lo hemos despertado (por lo tanto antes estaba dormido). </div>
<div>
<br /></div>
<div>
En cambio si lo dejamos en 'standby' eso no pasa. Porque dejamos el disco encendido, pero con energía al mínimo:</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">hdparm -y /dev/sdb1</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdb1:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> issuing standby command</span></div>
</div>
<div>
<br /></div>
<div>
Para ello hay quien recomienda smartctl. Para ello tendremos que instalarnos la utilidad (apt-get install smartmontools):</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">smartctl -i -n standby /dev/sda</span></div>
<div>
<br /></div>
<div>
Pero podemos usar como antes nuestro comando hdparm:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">hdparm -C /dev/sdb</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdb:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> drive state is: standby</span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Recordad que si queremos mirar o configurar una serie de discos que tengamos en el servidor, podemos hacerlo o uno a uno o con un comando solo. Imaginemos que tenemos desde el /dev/sdb al /dev/sdg :</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b>hdparm -C /dev/sd[b-g]</b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdb:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> drive state is: standby</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdc:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> drive state is: active/idle</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdd:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> drive state is: active/idle</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sde:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> drive state is: active/idle</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdf:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> drive state is: active/idle</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdg:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> drive state is: active/idle</span></div>
</div>
<div>
<br /></div>
<div>
O si son discos salteados:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b>hdparm -Y /dev/sd{b,g,f,e,d}</b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdb:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> issuing sleep command</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdg:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> issuing sleep command</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdf:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> issuing sleep command</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sde:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> issuing sleep command</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdd:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> issuing sleep command</span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<b>ERRORES FRECUENTES:</b><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">hdparm -d /dev/sdg </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdg:</span><br />
<span style="font-family: Courier New, Courier, monospace;"> HDIO_GET_DMA failed: Inappropriate ioctl for device</span><br />
<div>
<br /></div>
El comando hdparm, como hemos puesto al inicio de este artículo, se diseñó para dispositivos IDE. Por tanto, hay nomenclaturas que estan obsoletas. En este caso, la opción -d solo funciona sobre dispositivos IDE. </div>
</div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-32929602611323571182016-01-27T11:01:00.001+01:002016-01-27T11:01:16.596+01:00Deshabilitar VMware services del arranque de Ubuntu (vmware-USBarbitrator)<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5ewWBfA5qInfOfCPLCEKWllZNUpvwPJYoHnq0xVljGPfd5rEe1rZvHGbudvMkIFvWIBJW0hYxvPz1Dw5lldGcxu5CFoPagoKOjm7Tj6bHZ5rnpttmtaI5EE_aixJr0AUt6uswTquAVp0/s1600/VMWare-logo-cloud-computing.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5ewWBfA5qInfOfCPLCEKWllZNUpvwPJYoHnq0xVljGPfd5rEe1rZvHGbudvMkIFvWIBJW0hYxvPz1Dw5lldGcxu5CFoPagoKOjm7Tj6bHZ5rnpttmtaI5EE_aixJr0AUt6uswTquAVp0/s320/VMWare-logo-cloud-computing.jpg" width="320" /></a></div>
<div style="text-align: justify;">
<b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">VMware Inc.</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">, (VM de </span><i style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">Virtual Machine</i><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">) es una filial de </span><a href="https://es.wikipedia.org/wiki/EMC_Corporation" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="EMC Corporation">EMC Corporation</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> que proporciona </span><a href="https://es.wikipedia.org/wiki/Software" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Software">software</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> de </span><a href="https://es.wikipedia.org/wiki/Virtualizaci%C3%B3n" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Virtualización">virtualización</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">disponible para ordenadores compatibles </span><a href="https://es.wikipedia.org/wiki/X86" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="X86">X86</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">. Entre este software se incluyen </span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"><a class="mw-redirect" href="https://es.wikipedia.org/wiki/VMware_Workstation" style="background: none; color: #0b0080; text-decoration: none;" title="VMware Workstation">VMware Workstation</a></b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">, y los gratuitos</span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">VMware Server</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> y </span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">VMware Player</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">. El software de VMware puede funcionar en </span><a href="https://es.wikipedia.org/wiki/Microsoft_Windows" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Microsoft Windows">Windows</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">, </span><a class="mw-redirect" href="https://es.wikipedia.org/wiki/Linux" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Linux">Linux</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">, y en la plataforma</span><a class="mw-redirect" href="https://es.wikipedia.org/wiki/Mac_OS_X" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Mac OS X">Mac OS X</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> que corre en procesadores INTEL, bajo el nombre de </span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">VMware Fusion</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">. El nombre corporativo de la compañía es un juego de palabras usando la interpretación tradicional de las siglas «</span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">VM</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">» en los ambientes de computación, como </span><a href="https://es.wikipedia.org/wiki/M%C3%A1quina_virtual" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.4px; text-decoration: none;" title="Máquina virtual">máquinas virtuales</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"> (</span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">V</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">irtual </span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">M</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;">achines).</span></div>
<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.4px;"><br /></span>
<span style="background-color: white; color: #252525; font-family: sans-serif; line-height: 22.4px;"><span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/VMware">Wikipedia</a>)</span></span><br />
<br />
Si somos un usario que habitaulmente desde nuestro equipo no arrancamos máquinas virtuales, posiblemente nos interesará deshabilitar el servicio de VMWare. También puede que tengamos un error en el arranque tipo: "/run/systemd/generator.late/vmware-USBarbitrator".<br />
<br />
Se trata tanto del servicio vmware como del servicio vmware-USBArbitrator. Si no lo necesitamos, vamos a desinstalarlo:<br />
<br /><br /><span style="font-family: Courier New, Courier, monospace;">$ sudo update-rc.d vmware disable</span><div>
<span style="font-family: Courier New, Courier, monospace;">$ sudo update-rc.d vmware-USBArbitrator disable</span></div>
<br />
Si por ejemplo nos da algún error como este:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">update-rc.d: error: no runlevel symlinks to modify, aborting!</span><br />
<br />
Significa que la instalación no estaba 100% bien realizada o se han perdido archivos. Así que la recomendación que os podría hacer sería la de mover el script a otro sitio (por no borrarlo):<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$ sudo mv /etc/init.d/vmware-USBArbitrator /home/OtroLejanoLugar/</span><br />
<br />
<br />
Con esto no deberíamos tener más errores en el arranque o bien no cargaremos en el sistema modulos innecesarios.<br />
<br />
<br /></div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5282037860157731886.post-17033645797351154392015-11-13T10:24:00.001+01:002015-11-13T10:24:14.479+01:00ifdown: interface ethX not configured<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixhDBbLLZgim98D9rHIFhIYotPnqh70UzJRc8j7i-UHzoEwAKXFT66qgmXQ3kVLXmT2MT_LrTFVILSY-PBxox9PKvIYyGZjng5BU1OVywS3DNlz1xlRc3gz5tCTuUAfQYrz7N40pYUyJs/s1600/mic3.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixhDBbLLZgim98D9rHIFhIYotPnqh70UzJRc8j7i-UHzoEwAKXFT66qgmXQ3kVLXmT2MT_LrTFVILSY-PBxox9PKvIYyGZjng5BU1OVywS3DNlz1xlRc3gz5tCTuUAfQYrz7N40pYUyJs/s320/mic3.jpg" width="320" /></a></div>
<div style="text-align: justify;">
<i style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"><b>ifconfig</b></i><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> («interfaz de configuración») es un </span><a href="https://es.wikipedia.org/wiki/Programa_inform%C3%A1tico" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; text-decoration: none;" title="Programa informático">programa</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> disponible en varias versiones del </span><a href="https://es.wikipedia.org/wiki/Sistema_operativo" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; text-decoration: none;" title="Sistema operativo">sistema operativo</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> </span><a class="mw-redirect" href="https://es.wikipedia.org/wiki/UNIX" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; text-decoration: none;" title="UNIX">UNIX</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">, que permite configurar o desplegar numerosos parámetros de las </span><a href="https://es.wikipedia.org/wiki/Tarjeta_de_red" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; text-decoration: none;" title="Tarjeta de red">interfaces de red</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> residentes en el núcleo, como la </span><a href="https://es.wikipedia.org/wiki/Direcci%C3%B3n_IP" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; text-decoration: none;" title="Dirección IP">dirección IP</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> (dinámica o estática), o la </span><a href="https://es.wikipedia.org/wiki/M%C3%A1scara_de_red" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; text-decoration: none;" title="Máscara de red">máscara de red</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">. Si se llama sin argumentos suele mostrar la configuración vigente de las interfaces de red activas, con detalles como la </span><a href="https://es.wikipedia.org/wiki/Direcci%C3%B3n_MAC" style="background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; text-decoration: none;" title="Dirección MAC">dirección MAC</a><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> o el tráfico que ha circulado por las mismas hasta el momento. Las interfaces de red en Linux se suelen denominar eth (eth0, eth1, etc.).</span></div>
<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"><br /></span>
<span style="background-color: white; color: #252525; font-family: sans-serif; line-height: 22.3999996185303px;"><span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Ifconfig">Wikipedia</a>)</span></span><br />
<br />
ifup y ifdown son scripts de control de interfaz que controlan la activación y desactivación de las interfaces del sistema. Son equivalentes a decir ifconfig up o ifconfig down .<br />
<div>
<br /></div>
<div>
Como archivos relacionados con estos comandos podemos encontrar:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /etc/network/interfaces</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> definitions of network interfaces See interfaces(5) for more information.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /var/run/network/ifstate</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> current state of network interfaces</span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
En ocasiones nos puede pasar que queramos desactivar una interficie de red (eth1 por ejemplo) y nos da el siguiente error:</div>
<div>
<br /></div>
<span style="font-family: Courier New, Courier, monospace;">ifdown: interface eth1 not configured</span><br /><div>
<br /></div>
<div>
Bien, cuando esto pase tenemos dos opciones. Una es ir al archivo /etc/network/interfaces, comentar la linea auto eth1 y reiniciar. Otra es usar el comando ifdown, pero con el parámetro --force</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> --force</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Force configuration or deconfiguration of the interface.</span></div>
</div>
<div>
<br /></div>
<div>
Así pues, seria así: ifdown --force eth1</div>
<div>
<br /></div>
<div>
Con este parámetro, forzamos la desconfiguración de la interficie pese a que por alguna razón no sea 100% aconsejable (por ejemplo, pq tengamos servicios con puertos abiertos en escucha sobre esa interficie). </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-53221433727636916522015-11-02T16:45:00.004+01:002015-11-02T16:45:55.038+01:00LSC Project. Sincronizando OpenLDAP con otras bases de datos, etc<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF4XjlpvWR_yWEyFjPs2oCqc-GrrCUrWa3z8H5uT6Jp1nA_dKgaF4W8_TzAzuaEQN_wOISJEposZ9WSPNFDSsSmpOkI9R_GtODYVqFAbDIWyR1xTYxFJYisV0qdx42B_b6AFpcwi02MK4/s1600/lsc-instalar.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbldPbm0ZTmIbdR1BZKbYfFvrZXnwXo5-j7IuiszeYaB4Pv-oiU6BLuh192A-L0FwqtFOPtVFMj47p-IhOppK3X-j-A4oGGxycQOB7V8MEpjfTgtExAc2xEdNADJ4A66IfBQL2GQ8YPT8/s1600/lsc_logo_400px.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbldPbm0ZTmIbdR1BZKbYfFvrZXnwXo5-j7IuiszeYaB4Pv-oiU6BLuh192A-L0FwqtFOPtVFMj47p-IhOppK3X-j-A4oGGxycQOB7V8MEpjfTgtExAc2xEdNADJ4A66IfBQL2GQ8YPT8/s320/lsc_logo_400px.png" width="320" /></a></div>
<div style="text-align: justify;">
LSC es un conector Software Libre para sincronizar identidades entre un directorio LDAP y cualquier otra fuente de datos, incluyendo cualquier base de datos con un conector <a href="https://es.wikipedia.org/wiki/Java_Database_Connectivity">JDBC (Java Database Connectivity)</a>, otro servidor LDAP, etc.. </div>
<div style="text-align: justify;">
Esto nos puede ser util para infinidad de cosas, como la de sincronizar un directorio Active Directory con OpenLDAP (en cualquier dirección). De esta manera, podríamos tener un escenario de autenticación híbrido en el cual programas que necesiten AD o OpenLDAP puedan habitar alimentándose de una sóla base de datos. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwznO_XOI63F8VO3-6OwBX60JTfTIoOdZiWGCZGqk9kJ1TCT-kS77DUUtmHHi7t4iwI7y6LfSOzKE1R82Kgwt4mU4PnFI5a_0ds7q0AIUGUjh6rdXfeVZaOL7nsHkLBCJ83F4847ymJVA/s1600/ldapADsync.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwznO_XOI63F8VO3-6OwBX60JTfTIoOdZiWGCZGqk9kJ1TCT-kS77DUUtmHHi7t4iwI7y6LfSOzKE1R82Kgwt4mU4PnFI5a_0ds7q0AIUGUjh6rdXfeVZaOL7nsHkLBCJ83F4847ymJVA/s400/ldapADsync.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
Así pues, vamos a proceder a instalar el programa obteniéndolo de la web oficial: <a href="http://lsc-project.org/">http://lsc-project.org/</a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Tenemos dos maneras de hacerlo:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
La más gráfica, mediante un paquete deb:</div>
<div style="text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV5xnjk3SroR78tU-9gJ5HPjx1EotI3oMGun-_V0dzOaF37i7NyhMPsQFzK0Lg_FBFX7YbVlRr8kOMyOqFO0hHaK64T9eiRDz5xQcyUNiPc0k2KiM1fd6j7DgBH6lq-qvEJIK0Fd-fgOU/s1600/lsc-descargar.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV5xnjk3SroR78tU-9gJ5HPjx1EotI3oMGun-_V0dzOaF37i7NyhMPsQFzK0Lg_FBFX7YbVlRr8kOMyOqFO0hHaK64T9eiRDz5xQcyUNiPc0k2KiM1fd6j7DgBH6lq-qvEJIK0Fd-fgOU/s320/lsc-descargar.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Lo descargamos</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF4XjlpvWR_yWEyFjPs2oCqc-GrrCUrWa3z8H5uT6Jp1nA_dKgaF4W8_TzAzuaEQN_wOISJEposZ9WSPNFDSsSmpOkI9R_GtODYVqFAbDIWyR1xTYxFJYisV0qdx42B_b6AFpcwi02MK4/s1600/lsc-instalar.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF4XjlpvWR_yWEyFjPs2oCqc-GrrCUrWa3z8H5uT6Jp1nA_dKgaF4W8_TzAzuaEQN_wOISJEposZ9WSPNFDSsSmpOkI9R_GtODYVqFAbDIWyR1xTYxFJYisV0qdx42B_b6AFpcwi02MK4/s320/lsc-instalar.png" width="316" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Doble click en el archivo .deb</td></tr>
</tbody></table>
<div style="text-align: left;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoSSCyNwHX9nWnWvOM0wSy3CnhiPP5Ac8ub0RlKDfwWvEFh4WqHOz5x5JI3SLDos1cdoQg6Lb-LlCPwhky4Cbqk-WLmmo0PrcmCBoqjTsRdUu8zjemm11kG2RgNUzjEI9AuaKQTW_vxi8/s1600/lsc-terminal.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="90" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoSSCyNwHX9nWnWvOM0wSy3CnhiPP5Ac8ub0RlKDfwWvEFh4WqHOz5x5JI3SLDos1cdoQg6Lb-LlCPwhky4Cbqk-WLmmo0PrcmCBoqjTsRdUu8zjemm11kG2RgNUzjEI9AuaKQTW_vxi8/s320/lsc-terminal.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Comprobamos que todo ha ido correctamente</td></tr>
</tbody></table>
<br />
<h2 class="sectionedit9" id="files_location" style="background-color: rgba(255, 255, 255, 0.8); box-sizing: border-box; color: #333333; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 400; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;">
Localización de los archivos:</h2>
<div class="level2" style="background-color: rgba(255, 255, 255, 0.8); box-sizing: border-box; color: #555555; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 22.8571434020996px;">
<ul style="box-sizing: border-box; margin-bottom: 10px; margin-top: 0px;">
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/usr/bin/lsc: wrapper to launch LSC</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/etc/lsc/: configuration</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/var/log/lsc/: logs</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/etc/init.d/lsc: init script (for asynchronous connectors)</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/etc/default/lsc: init script configuration</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/etc/cron.d/lsc: cron configuration</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/usr/lib/lsc/: LSC libraries</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/var/lib/lsc/nagios/: monitoring scripts</div>
</li>
<li class="level1" style="box-sizing: border-box;"><div class="li" style="box-sizing: border-box;">
/usr/share/doc/lsc: sample scripts</div>
</li>
</ul>
</div>
<br />
<br />
<div style="text-align: justify;">
Tambien podemos descargarnos <b>tar.gz</b> y descomprimirlo. Ya viene compilado y listo para usarse. En este caso, pese a que soy defensor de usar los paquetes deb y los repositorios (sobretodo los oficiales) en este caso creo que lo mejor es esta opción. Además, <a href="http://lsc-project.org/wiki/documentation/2.1/sample">los ejemplos</a> vienen pensados justamente para hacerlo de esta manera (rutas, etc). </div>
<br />
Así que.. queda probarlo:<br />
<br />
<div>
<div>
./lsc-sample <option></option></div>
<div>
<br /></div>
<div>
One option from available options is:</div>
<div>
--import <file> [<separator>] Import data from CSV file</separator></file></div>
<div>
--show Show data from database</div>
<div>
--drop Drop the table csvdata from database</div>
<div>
--start-ldap-server Launch an embedded OpenDJ LDAP server</div>
<div>
--stop-ldap-server Halt an embedded OpenDJ LDAP server</div>
<div>
--run Run the synchronization task</div>
<div>
--clean Remove all files from disk</div>
<div>
--help Print informations</div>
</div>
<div>
<br /></div>
<div>
Vamos a probar una sincronización a modo de ejemplo con las herramientas incrustadas que lleva el propio programa. </div>
<div>
<br /></div>
<div>
Miraremos de cargar los registros que queremos sincronizar en la base de datos:</div>
<br /><b><i>bin/lsc-sample --import sample.csv</i></b><br /><br />Podemos comprobar el contenido mediante la siguiente linea:<br /><br /><b><i>bin/lsc-sample --show</i></b><div>
<br /></div>
<div>
<div>
Arrancaremos el servidor LDAP incorporado de pruebas:</div>
<div>
<br /></div>
<div>
#<b>lsc-2.1.3/sample/hsqldb$ bin/lsc-sample --start-ldap-server</b></div>
<div>
<div>
Starting LDAP server on ldap://localhost:33389/ ... segons /home/ediaz/Escritorio/lsc-2.1.3/sample/hsqldb/bin/../etc</div>
<div>
nov 02 15:36:05 - INFO - Logging configuration successfully loaded from /home/eithel/Escritorio/lsc-2.1.3/sample/hsqldb/bin/../etc/logback.xml </div>
<div>
nov 02 15:36:05 - INFO - LSC configuration successfully loaded from /home/eithel/Escritorio/lsc-2.1.3/sample/hsqldb/bin/../etc/</div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
Como el ejemplo lo hace sobre 127.0.0.1 y puede ser que no dispongamos de una herramienta gráfica, podemos mirar de probarlo mediante ldapsearch:</div>
<br />
<br />
<b>ldapsearch -D "cn=Directory Manager" -w secret -p 33389 -h localhost -b "dc=lsc-project,dc=org" -s sub "(objectclass=*)"</b><br />
<i># extended LDIF</i><br />
<i>#</i><br />
<i># LDAPv3</i><br />
<i># base <dc dc="org" lsc-project=""> with scope subtree</dc></i><br />
<i># filter: (objectclass=*)</i><br />
<i># requesting: ALL</i><br />
<i>#</i><br />
<i><br /></i>
<i># lsc-project.org</i><br />
<i>dn: dc=lsc-project,dc=org</i><br />
<i>dc: lsc-project</i><br />
<i>objectClass: domain</i><br />
<i>objectClass: top</i><br />
<i><br /></i>
<i># Sample, lsc-project.org</i><br />
<i>dn: ou=Sample,dc=lsc-project,dc=org</i><br />
<i>description: Sample subtree</i><br />
<i>ou: Sample</i><br />
<i>objectClass: organizationalUnit</i><br />
<i>objectClass: top</i><br />
<i><br /></i>
<i># search result</i><br />
<i>search: 2</i><br />
<i>result: 0 Success</i><br />
<i><br /></i>
<i># numResponses: 3</i><br />
<i># numEntries: 2</i><br />
<div>
<br /></div>
<div>
Con la base de datos cargada y un servidor LDAP en donde migrar esos datos, nos dispondremos a hacer la migración:</div>
<div>
<br /></div>
<div>
#<b><i>bin/lsc-sample --run</i></b></div>
<br />
y vemos el resultado de nuevo con la busqueda ldapsearch:<br />
<ul style="text-align: left;">
<li>URL: <a href="ldap://localhost:33389/">ldap://localhost:33389/</a></li>
<li>Base DN: dc=lsc-project,dc=org</li>
<li>Bind DN: cn=Directory Manager</li>
<li>Password: secret</li>
</ul>
<b>ldapsearch -D "cn=Directory Manager" -w secret -p 33389 -h localhost -b "dc=lsc-project,dc=org" -s sub "(objectclass=*)"</b><br />
<i># extended LDIF</i><br />
<i>#</i><br />
<i># LDAPv3</i><br />
<i># base <dc dc="org" lsc-project=""> with scope subtree</dc></i><br />
<i># filter: (objectclass=*)</i><br />
<i># requesting: ALL</i><br />
<i>#</i><br />
<i><br /></i>
<i># lsc-project.org</i><br />
<i>dn: dc=lsc-project,dc=org</i><br />
<i>dc: lsc-project</i><br />
<i>objectClass: domain</i><br />
<i>objectClass: top</i><br />
<i><br /></i>
<i># Sample, lsc-project.org</i><br />
<i>dn: ou=Sample,dc=lsc-project,dc=org</i><br />
<i>description: Sample subtree</i><br />
<i>ou: Sample</i><br />
<i>objectClass: organizationalUnit</i><br />
<i>objectClass: top</i><br />
<i><br /></i>
<i># clem.oudot@gmail.com, Sample, lsc-project.org</i><br />
<i>dn: mail=clem.oudot@gmail.com,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9Z3Y5ZGlzaFhaZlNQeGR6ekZ0SU1xMlN1WHp5NU5NTDVSdGJlNXc9PQ=</i><br />
<i> =</i><br />
<i>mail: clem.oudot@gmail.com</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>uid: c.oudot</i><br />
<i>cn: Oudot, Clement</i><br />
<i>sn: Oudot</i><br />
<i><br /></i>
<i># jonathan@philipoux.net, Sample, lsc-project.org</i><br />
<i>dn: mail=jonathan@philipoux.net,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9QUlOd0RoWDROTG5aSE9TUDVpKzRtZUJSTzRkMmF2eFNTaDUwWVE9PQ=</i><br />
<i> =</i><br />
<i>mail: jonathan@philipoux.net</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>carLicense: BHU772</i><br />
<i>carLicense: DED899</i><br />
<i>uid: j.clarke</i><br />
<i>cn: Clarke, Jonathan</i><br />
<i>sn: Clarke</i><br />
<i><br /></i>
<i># thomas@aepik.net, Sample, lsc-project.org</i><br />
<i>dn: mail=thomas@aepik.net,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9Ynh0Y2FWb1g1cmpRcHZSU29PSEd5ME94VGtGSWZGRnlOK3h1SHc9PQ=</i><br />
<i> =</i><br />
<i>mail: thomas@aepik.net</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>uid: t.chemineau</i><br />
<i>cn: Chemineau, Thomas</i><br />
<i>sn: Chemineau</i><br />
<i><br /></i>
<i># sebastien.bahloul@gmail.com, Sample, lsc-project.org</i><br />
<i>dn: mail=sebastien.bahloul@gmail.com,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9dzRUbDhPOEU5dW9mc2tFZDBqR0JYNW1yTzVPMWZmakFJOUdMdkE9PQ=</i><br />
<i> =</i><br />
<i>mail: sebastien.bahloul@gmail.com</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>uid: s.bahloul</i><br />
<i>cn: Bahloul, Sebastien</i><br />
<i>sn: Bahloul</i><br />
<i><br /></i>
<i># remy@schermesser.com, Sample, lsc-project.org</i><br />
<i>dn: mail=remy@schermesser.com,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9eE9odElwcENEN3RLRlZONSt4Ris1WkNpRlp5Wmx4NlBYV3M5bUE9PQ=</i><br />
<i> =</i><br />
<i>mail: remy@schermesser.com</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>uid: r.schermesser</i><br />
<i>cn: Schermesser, Remy-Christophe</i><br />
<i>sn: Schermesser</i><br />
<i><br /></i>
<i># epereira@linagora.com, Sample, lsc-project.org</i><br />
<i>dn: mail=epereira@linagora.com,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9YzUwaFEra2RPLzRLQjI4WG9tMmREQm83KzFFOWo4Wi9GbktaZkE9PQ=</i><br />
<i> =</i><br />
<i>mail: epereira@linagora.com</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>uid: e.pereira</i><br />
<i>cn: Pereira, Esteban</i><br />
<i>sn: Pereira</i><br />
<i><br /></i>
<i># dcoutadeur@linagora.com, Sample, lsc-project.org</i><br />
<i>dn: mail=dcoutadeur@linagora.com,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9Z2VKUkpFa012dE9wNGZvWDB1anVxeEVHMXZZaE1Ob3cvUmp6T0E9PQ=</i><br />
<i> =</i><br />
<i>mail: dcoutadeur@linagora.com</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>uid: d.coutadeur</i><br />
<i>cn: Coutadeur, David</i><br />
<i>sn: Coutadeur</i><br />
<i><br /></i>
<i># rouazana@linagora.com, Sample, lsc-project.org</i><br />
<i>dn: mail=rouazana@linagora.com,ou=Sample,dc=lsc-project,dc=org</i><br />
<i>userPassword:: e1NTSEF9YjJKUWQ3NUtTaDlCWnJnUTIrd2E1NWNzNVdNSFIreFpXeG5lbkE9PQ=</i><br />
<i> =</i><br />
<i>mail: rouazana@linagora.com</i><br />
<i>objectClass: person</i><br />
<i>objectClass: organizationalPerson</i><br />
<i>objectClass: inetOrgPerson</i><br />
<i>objectClass: top</i><br />
<i>uid: r.ouazana</i><br />
<i>cn: Ouazana, Raphael</i><br />
<i>sn: Ouazana</i><br />
<i><br /></i>
<i># search result</i><br />
<i>search: 2</i><br />
<i>result: 0 Success</i><br />
<i><br /></i>
<i># numResponses: 11</i><br />
<i># numEntries: 10</i><br />
<div>
<br /></div>
Efectivamente, ha realizado la sincronización perfectamente.<br />
<br />
En resumen, lo que hemos hecho es, dado un csv, cargar una base de datos intermedia. Luego, con los datos cargados en esa base de datos, los migramos a otro servidor LDAP (OpenLDAP, AD, etc).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFfdxS4xosO1QmWi3JH7q2EOG3dbHB-SmQzgsfavO6BqlG9z0Of2gIPSnoOsR80oNIqMh6v4kre9eiYjR0kqD8PZhwdQ0iDIAeCC8YeZhnej5SMLXe50aXw5WuaWGujZvJmLcL7vM5LLc/s1600/lsc-flow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFfdxS4xosO1QmWi3JH7q2EOG3dbHB-SmQzgsfavO6BqlG9z0Of2gIPSnoOsR80oNIqMh6v4kre9eiYjR0kqD8PZhwdQ0iDIAeCC8YeZhnej5SMLXe50aXw5WuaWGujZvJmLcL7vM5LLc/s640/lsc-flow.png" width="640" /></a></div>
<h2 class="sectionedit9" id="files_location" style="background-color: rgba(255, 255, 255, 0.8); box-sizing: border-box; color: #333333; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 400; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;">
<br /></h2>
<br />
<br />
<br />
<br />
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-24871824205483990412015-10-21T11:53:00.001+02:002015-10-21T11:53:18.681+02:00Restablecer contraseña olvidada mediante LiveCD y chroot <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMzbSwK80YFSYPxYh-X3xmxCrmBTRsi5kptfhXY05jYFLxbtWrEAdGPHsDCsSFrurmSyJRIk1n4hHYqM5EHa5fUQTyn-vKI92MG_5B8m2U4XZUIZ9GYbYYDvxMAjnOV9Dymr6PoZ3Kyro/s1600/chroot.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="174" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMzbSwK80YFSYPxYh-X3xmxCrmBTRsi5kptfhXY05jYFLxbtWrEAdGPHsDCsSFrurmSyJRIk1n4hHYqM5EHa5fUQTyn-vKI92MG_5B8m2U4XZUIZ9GYbYYDvxMAjnOV9Dymr6PoZ3Kyro/s320/chroot.png" width="320" /></a></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
<b>chroot</b> en los <a class="mw-redirect" href="https://es.wikipedia.org/wiki/Sistemas_operativos" style="background: none; color: #0b0080; text-decoration: none;" title="Sistemas operativos">sistemas operativos</a> derivados de <a href="https://es.wikipedia.org/wiki/Unix" style="background: none; color: #0b0080; text-decoration: none;" title="Unix">Unix</a>, es una operación que invoca un proceso, cambiando para este y sus hijos el <a href="https://es.wikipedia.org/wiki/Directorio_ra%C3%ADz" style="background: none; color: #0b0080; text-decoration: none;" title="Directorio raíz">directorio raíz</a> del sistema. "chroot" puede referirse a la <a href="https://es.wikipedia.org/wiki/Llamada_al_sistema" style="background: none; color: #0b0080; text-decoration: none;" title="Llamada al sistema">llamada de sistema</a> <tt style="font-family: monospace, Courier;">chroot(2)</tt> o al programa ejecutable <tt style="font-family: monospace, Courier;">chroot(8)</tt>. Comúnmente, el entorno virtual creado por chroot a partir de la nueva raíz del sistema se conoce como "jaula chroot".</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
El sistema chroot fue introducido por <a href="https://es.wikipedia.org/wiki/Bill_Joy" style="background: none; color: #0b0080; text-decoration: none;" title="Bill Joy">Bill Joy</a> el <a href="https://es.wikipedia.org/wiki/18_de_marzo" style="background: none; color: #0b0080; text-decoration: none;" title="18 de marzo">18 de marzo</a> de <a href="https://es.wikipedia.org/wiki/1982" style="background: none; color: #0b0080; text-decoration: none;" title="1982">1982</a> (17 meses antes de que <a class="mw-redirect" href="https://es.wikipedia.org/wiki/BSD" style="background: none; color: #0b0080; text-decoration: none;" title="BSD">BSD 4.2</a> fuera publicado) para probar su sistema de instalación y construcción.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
Al usar "chroot" para invocar un proceso, se impedirá al mismo y a sus procesos hijos acceder por su nombre a ningún fichero que esté por encima del nuevo directorio raíz. Esto es entendido a menudo como un dispositivo de seguridad, ya que en teoría crea una zona segura para ejecutar un programa que provoca desconfianza, no está probado, o de alguna forma puede presentar un comportamiento peligroso para la integridad del sistema. Sin embargo, cabe señalar que las jaulas chroot no son tan seguras como otro tipo de jaulas o la <a href="https://es.wikipedia.org/wiki/Virtualizaci%C3%B3n" style="background: none; color: #0b0080; text-decoration: none;" title="Virtualización">virtualización</a>.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em;">
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/Chroot">Wikipedia</a>)</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Y ahora la pregunta sería... ¿y en qué nos podría ayudar chroot para restablecer nuestra contraseña?. Pues bien, de lo que se trata es primero ser <i>root</i> de nuestro PC. Una vez somos root, evidentemente ya tenemos acceso a las herramientas para cambiar contraseñas. Cuando cambiamos contraseñas, lo hacemos mediante el comando <i>passwd</i>, que lo que hace es leerlas y grabarlas en disco. Así pues, si arrancamos la máquina con un LiveCD ya tendremos root en esa máquina. Lo malo es que el sistema de archivos con el que arranca, evidentemente, está en memoria y no es donde realmente están las contraseñas, sino que están en el disco duro. Así pues, chroot nos ofrece la posibilidad de "cambiar" nuestra raíz del sistema de archivos (la del LiveCD) por otro sistema de archivos (la de la partición en donde se encuentran las contraseñas). Si miramos el esquema de arriba puede que entendamos mejor el cambio de sistema de archivos. Arriba de todo tenemos / (root) pero luego de hacer el chroot convertimos /mnt en nuestro nuevo / root. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
De acuerdo, ahora que vemos todas las herramientas que usaremos (LiveCD, passwd, mount, chroot) hagamos el procedimiento paso a paso (cada uno que lo adecue a su escenario):</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Insertamos en LiveCD de 32 o 64bits. No hace falta que sea la misma distribución, pero si que si el sistema en donde estan las contraseñas es 32bits o 64bits, el LiveCD sea de los mismos bits. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Una vez arrancado el sistema LiveCD, abrimos un terminal y escribimos</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">sudo -s</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Con esto seremos ya root de la maquina. Crearemos una carpeta en donde montaremos la partición de nuestro disco duro en donde se encuentran las contraseñas (no montes la /boot o la swap!). Imaginemos que la partición que buscamos es la /dev/sda2 . </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">mkdir /mnt/recuperar</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">mount /dev/sda2 /mnt/recuperar</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Pues bien, ahora ya tenemos el sistema de archivos del PC montando como una carpeta del sistema de archivos del LiveCD. Ahora toca hacer el cambiazo:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">chroot /mnt/recuperar</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Ya lo tenemos cambiado. Ahora nuestro / (root), es el de la partición de nuestro disco duro. Ahora toca cambiar la contraseña, que lo hacemos como se hace habitualmente. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">passwd</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Como somos root, no nos preguntará por nuestra anterior contraseña. Si por el contrario queremos cambiar la contraseña de otro usuario que no sea el root deberemos mandarlo por parámetro:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">passwd user</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Con esto ya habremos cambiado la contraseña. Ahora salimos del chroot mediante exit y desmontamos la partición:</div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">exit</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">umount /mnt/recuperar</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Ahora ya podemos apagar el sistema y arrancar con normalidad y con la contraseña restablecida. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-8571567411139003382015-10-20T10:52:00.000+02:002015-10-20T10:52:10.755+02:00Evitar bdb_equality_candidates en OpenLDAP creando índices <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGzC8CJJ3ZQ0vP9S8HXI9sAtfWEoTfgxnEfnPHVNT3BgcZ8xODROmIXcswpO28eB5yBhKokT7lTO7DWJm9Gn2lk4qwZ0QERbyTc0quSOzDLDh9FDRagoKAAPzFduTpuP1srQ03Y2nVA8g/s1600/index_database.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGzC8CJJ3ZQ0vP9S8HXI9sAtfWEoTfgxnEfnPHVNT3BgcZ8xODROmIXcswpO28eB5yBhKokT7lTO7DWJm9Gn2lk4qwZ0QERbyTc0quSOzDLDh9FDRagoKAAPzFduTpuP1srQ03Y2nVA8g/s320/index_database.gif" width="320" /></a></div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
El <b>índice</b> de una <a href="https://es.wikipedia.org/wiki/Base_de_datos" style="background: none; color: #0b0080; text-decoration: none;" title="Base de datos">base de datos</a> es una <a href="https://es.wikipedia.org/wiki/Estructura_de_datos" style="background: none; color: #0b0080; text-decoration: none;" title="Estructura de datos">estructura de datos</a> que mejora la velocidad de las operaciones, por medio de identificador único de cada fila de una tabla, permitiendo un rápido acceso a los <a href="https://es.wikipedia.org/wiki/Registro_(base_de_datos)" style="background: none; color: #0b0080; text-decoration: none;" title="Registro (base de datos)">registros</a> de una <a href="https://es.wikipedia.org/wiki/Tabla_(base_de_datos)" style="background: none; color: #0b0080; text-decoration: none;" title="Tabla (base de datos)">tabla</a> en una base de datos. Al aumentar drásticamente la velocidad de acceso, se suelen usar, sobre aquellos <a class="mw-redirect" href="https://es.wikipedia.org/wiki/Campo_(base_de_datos)" style="background: none; color: #0b0080; text-decoration: none;" title="Campo (base de datos)">campos</a> sobre los cuales se hacen frecuentes búsquedas.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
El índice tiene un funcionamiento similar al índice de un <a href="https://es.wikipedia.org/wiki/Libro" style="background: none; color: #0b0080; text-decoration: none;" title="Libro">libro</a>, guardando parejas de elementos: el elemento que se desea indexar y su posición en la base de datos. Para buscar un elemento que esté indexado, sólo hay que buscar en el índice dicho elemento para, una vez encontrado, devolver el registro que se encuentre en la posición marcada por el índice.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
Los índices pueden ser creados usando una o más <a href="https://es.wikipedia.org/wiki/Columna_(base_de_datos)" style="background: none; color: #0b0080; text-decoration: none;" title="Columna (base de datos)">columnas</a>, proporcionando la base tanto para búsquedas rápidas al azar como de un ordenado acceso a registros eficiente.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
Los índices son construidos sobre <a href="https://es.wikipedia.org/wiki/%C3%81rbol-B" style="background: none; color: #0b0080; text-decoration: none;" title="Árbol-B">árboles B</a>, <a class="mw-redirect" href="https://es.wikipedia.org/wiki/%C3%81rbol-B%2B" style="background: none; color: #0b0080; text-decoration: none;" title="Árbol-B+">B+</a>, <a href="https://es.wikipedia.org/wiki/%C3%81rbol-B*" style="background: none; color: #0b0080; text-decoration: none;" title="Árbol-B*">B*</a> o sobre una mezcla de ellos, funciones de cálculo u otros métodos.</div>
<div style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px; margin-bottom: 0.5em; margin-top: 0.5em; text-align: justify;">
El espacio en disco requerido para almacenar el índice es típicamente menor que el espacio de almacenamiento de la tabla (puesto que los índices generalmente contienen solamente los campos clave de acuerdo con los que la tabla será ordenada, y excluyen el resto de los detalles de la tabla), lo que da la posibilidad de almacenar en memoria los índices de tablas que no cabrían en ella. En una <a href="https://es.wikipedia.org/wiki/Base_de_datos_relacional" style="background: none; color: #0b0080; text-decoration: none;" title="Base de datos relacional">base de datos relacional</a> un índice es una copia de una parte de la tabla.</div>
<span style="font-size: xx-small;">(Fuente <a href="https://es.wikipedia.org/wiki/%C3%8Dndice_(base_de_datos)">Wikipedia</a>)</span><br />
<br />
Cuando en nuestro log aparece algo como :<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Oct 20 10:22:01 server slapd[16752]: <= <b>bdb_equality_candidates</b>: (memberUid) not indexed</span><br />
<br />
quiere decir que se ha realizado una búsqueda por un campo el cual no esta indexado y ha sido consultado mediante <i>equal</i> (ya veremos más adelante que <a href="http://www.openldap.org/doc/admin24/slapdconf2.html">significa</a>). De haber estado indexado, la búsqueda sería más rápida. Así pues, una vez creada nuestra base de datos deberíamos indexarla por aquellos campos que sabemos que van a ser consultados.<br />
<br />
Creamos un archivo LDIF llamado, por ejemplo, olcDbIndex.ldif con este contenido (puedes variarlo según tus necesidades):<br /><pre style="background-color: #f5f6f7; border: 1px solid rgb(210, 211, 215); font-size: 13px; line-height: 2em; margin: 2em 1.5em; outline: 0px; overflow: auto; padding: 1em; vertical-align: baseline; word-wrap: break-word;"><span class="anchor" id="line-1-3" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>dn: olcDatabase={1}hdb,cn=config
<span class="anchor" id="line-2-2" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>changetype: modify
<span class="anchor" id="line-3-2" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-4-2" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: cn pres,sub,eq
<span class="anchor" id="line-5-1" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-6-1" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-7-1" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: sn pres,sub,eq
<span class="anchor" id="line-8-1" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-9-1" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-10-1" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: uid pres,sub,eq
<span class="anchor" id="line-11" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-12" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-13" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: displayName pres,sub,eq
<span class="anchor" id="line-14" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-15" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-16" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: default sub
<span class="anchor" id="line-17" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-18" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-19" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: uidNumber eq
<span class="anchor" id="line-20" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-21" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-22" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: gidNumber eq
<span class="anchor" id="line-23" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-24" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-25" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: mail,givenName eq,subinitial
<span class="anchor" id="line-26" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>-
<span class="anchor" id="line-27" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>add: olcDbIndex
<span class="anchor" id="line-28" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>olcDbIndex: dc eq</pre>
Para saber exactamente que significa pres, sub y eq sería conveniente saber estas definiciones:<br />
<ul style="text-align: left;">
<li><b>pres</b> (presence) debe usarse si buscamos mediante un atributo especifico.</li>
<li><b>approx</b> (Approximate) se debe usar si buscamos por resultados que sean similares a nuestra busqueda "sn~=person". Es decir, que el resultado se aproxime. </li>
<li><b>sub</b> (substring) debe utilizar en las búsquedas del timpo “sn=sm*”. Es decir, con comodines. </li>
<li><b>eq</b> (equality) se debe usar en comparaciones directas. Es decir, en comparaciones de igualdad.</li>
</ul>
<div>
Una vez entendido y generado el archivo LDIF, ahora tenemos que inyectarlo en la base de datos mediante el comando ldapmodify :<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">ldapmodify -Y EXTERNAL -H ldapi:/// -f ./olcDbIndex.ldif</span><br /><br />
Importante crear siempre una <a href="http://www.openldap.org/doc/admin24/maintenance.html">copia de seguridad</a> antes de manipular la base de datos.<br />
<br />
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5282037860157731886.post-78737370836858480892015-10-16T11:42:00.001+02:002015-11-03T16:46:24.786+01:00Reescanear manualmente el sistema de archivos de owncloud<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmnrfML4tITVopsIWHk1fwSJP0dzEFy0LSxOWlY41uWNRocS7Nzs1RVq_ZuFHHZV-XdonJujl2QqZGXUxEdLSvfvNt5LHgHlEJlSF2MxInc5fIdlPe_gQHGdaw30KqBN68kaoIOOdSoR8/s1600/ownCloud.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmnrfML4tITVopsIWHk1fwSJP0dzEFy0LSxOWlY41uWNRocS7Nzs1RVq_ZuFHHZV-XdonJujl2QqZGXUxEdLSvfvNt5LHgHlEJlSF2MxInc5fIdlPe_gQHGdaw30KqBN68kaoIOOdSoR8/s320/ownCloud.png" width="320" /></a><br />
<div style="text-align: justify;">
En una entrada anterior explicaba como instalar un servidor owncloud:</div>
<br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="http://eithel-inside.blogspot.com.es/2015/02/owncloud-https-mysql-openldap-en-ubuntu.html">ownCloud + https + MySQL + openLDAP en Ubuntu 14.04 LTS</a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
En ocasiones podemos necesitar reescanear el sistema de archivos de owncloud. ¿Por qué podemos necesitarlo? Imaginemos el escenario en el cual usemos el sistema de archivos de owncloud de manera compartida con otros servicios como ftp o ssh. En esos casos, subir un archivo directamente al espacio de directorios de owncloud haría que hubiera una incongruencia entre lo que realmente está en el sistema de archivos y lo que la base de datos de owncloud cree que tiene. Este uso no corresponde con las buenas prácticas de uso de owncloud (<a href="https://doc.owncloud.org/server/7.0/admin_manual/issues/index.html#debugging-sync-issues">Debugging Sync-Issues</a>) , pero a la práctica es algo que se puede hacer y se hace. Un ejemplo claro es cuando un usuario pierde un archivo y quiere que se lo restauremos desde una copia de seguridad. Se lo hacemos y luego.. toca reescanear su directorio manualmente. Así pues.. vamos a ver como se hace:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Para escanear manualmente el sistema de archivos tenemos ejecutable php en el directorio del owncloud llamado console.php. Con este archivo podemos hacer diversas operaciones. La que nos interesa de escanear el directorio lo haremos mediante el parámetro files:scan . Para poder ejecutar dicho archivo, deberemos hacerlo desde el usuario al cual pertenece dicho archivo. Lo normal es que pertenezca a <i>www-data</i> o <i>root</i>. Así pues, si pertenece a <i>www-data</i>, como seguramente no tendrá una shell declarada y no tendrá password, lo haremos ejecutaremos mediante <i>sudo</i>. Primero entramos en la carpeta en donde tengamos en owncloud instalado y luego ejecutamos el console.php:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: "courier new" , "courier" , monospace;">cd /var/www/owncloud</span></div>
<i></i><br />
<div style="text-align: justify;">
<i><i><span style="font-family: "courier new" , "courier" , monospace;">sudo -u www-data php console.php files:scan usuario<usuario></usuario></span></i></i></div>
<i>
</i><br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
En donde usuario <usuario>lo sustituiremos por el nombre de usuario al cual queramos reescanear su directorio. Si queremos reescanear TODO el sistema de archivos de owncloud:</usuario></div>
<div>
<div style="text-align: justify;">
<br /></div>
<i></i><br />
<div style="text-align: justify;">
<i><i><span style="font-family: "courier new" , "courier" , monospace;">sudo -u www-data php console.php files:scan --all</span></i></i></div>
<i>
</i><br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Si esta práctica de reescaneo es muy común, es posible que queramos <a href="https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/background_jobs_configuration.html">definir trabajos en segundo plano</a>. </div>
<div style="text-align: justify;">
<br /></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
</div>
Unknownnoreply@blogger.com0