seguridad https://keopx.net/ es Crear claves GPG2 en GNU/Linux con Ed25519 https://keopx.net/blog/crear-claves-gpg2-en-gnulinux-con-ed25519 <span>Crear claves GPG2 en GNU/Linux con Ed25519</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"> <p>Vamos a crear un par de claves GPG2 basados en cifrado <em>Ed25519</em>. Lo realizaremos en la consola aunque también se puede realizar utilizando "Contraseñas y claves de cifrado".</p> <p>A continuación, invocamos gpg en la consola con la opción <em>--expert</em> y <em>--full-gen-key</em>.</p> <pre> <code class="language-bash">$ gpg2 --expert --full-gen-key gpg (GnuPG) 2.1.8; Copyright (C) 2015 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.</code></pre><p>Luego, seleccionamos el <em>9</em> para seleccionar la clave principal de <em>ECC</em> y la subclave de cifrado <em>de ECC</em>.</p> <pre> <code class="language-bash">Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) (7) DSA (set your own capabilities) (8) RSA (set your own capabilities) (9) ECC and ECC (10) ECC (sign only) (11) ECC (set your own capabilities) Your selection? 9</code></pre><p>La siguiente es la <strong>selección importante</strong>. Seleccionamos <em>1</em> para seleccionar "<em>Curve25519</em>".</p> <pre> <code class="language-bash">Please select which elliptic curve you want: (1) Curve 25519 (2) NIST P-256 (3) NIST P-384 (4) NIST P-521 (5) Brainpool P-256 (6) Brainpool P-384 (7) Brainpool P-512 (8) secp256k1 Your selection? 1</code></pre><p>Verás una <em>ADVERTENCIA</em>, pero es lo que quieres.</p> <pre> <code class="language-bash">gpg: WARNING: Curve25519 is not yet part of the OpenPGP standard. Use this curve anyway? (y/N) y</code></pre><p>Se le pregunta sobre la caducidad de la clave.</p> <pre> <code class="language-bash">Please specify how long the key should be valid. 0 = key does not expire &lt;n&gt; = key expires in n days &lt;n&gt;w = key expires in n weeks &lt;n&gt;m = key expires in n months &lt;n&gt;y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y </code></pre><p>Luego, pregunta sobre una identidad de usuario.</p> <pre> <code class="language-bash"> GnuPG needs to construct a user ID to identify your key. Real name: keopx Email address: keopx@keopx.net Comment: You selected this USER-ID: "keopx &lt;keopx@keopx.net&gt;" </code></pre><p>Por último, pide confirmación.</p> <pre> <code class="language-bash">Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o</code></pre><p>Entonces, va así.</p> <pre> <code class="language-bash">We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. </code></pre><p>Pide a la frase de contraseña las claves por ventana emergente y, a continuación, finaliza.</p> <pre> <code class="language-bash">gpg: key D1A0681AAEDE141B marked as ultimately trusted gpg: directory '/home/user/.gnupg/openpgp-revocs.d' created gpg: revocation certificate stored as '/home/user/.gnupg/openpgp-revocs.d/4E2A32714B8E5ADAECA181ABD1A0681AAEDE141B.rev' public and secret key created and signed. pub ed25519 2019-01-13 [SC] 4E2A32714B8E5ADAECA181ABD1A0681AAEDE141B 4E2A32714B8E5ADAECA181ABD1A0681AAEDE141B uid keopx &lt;keopx@keopx.net&gt; sub cv25519 2019-01-13 [E] </code></pre><p>Referencia:</p> <ul><li><a href="https://web.archive.org/web/20210118112155/https://debconf17.debconf.org/talks/162/">https://debconf17.debconf.org/talks/162/</a></li> <li><a href="https://web.archive.org/web/20210118112155/https://www.keopx.net/blog/crear-claves-gpg-en-gnulinux">https://www.keopx.net/blog/crear-claves-gpg-en-gnulinux</a></li> </ul></div> </div> <span><span>keopx</span></span> <span><time datetime="2019-01-13T11:19:23+01:00" title="Domingo, Enero 13, 2019 - 11:19">Dom, 13/01/2019 - 11:19</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/gpg" hreflang="es">GPG</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/seguridad" hreflang="es">Seguridad</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/gpg" hreflang="es">GPG</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=301&amp;2=field_comments&amp;3=comment" token="aKhbvLK9H1YjgGr-ZNN1elbev_LB5TsJErSit8E7BMo"></drupal-render-placeholder> </div> </div> </section> Sun, 13 Jan 2019 10:19:23 +0000 keopx 301 at https://keopx.net https://keopx.net/blog/crear-claves-gpg2-en-gnulinux-con-ed25519#comments Instalar certificados SSL en Debian 9 con certbot (Let's Encrypt - Free SSL/TLS Certificates) https://keopx.net/blog/instalar-certificados-ssl-en-debian-9-con-certbot-lets-encrypt-free-ssltls-certificates <span>Instalar certificados SSL en Debian 9 con certbot (Let&#039;s Encrypt - Free SSL/TLS Certificates)</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Hace tiempo escribit un articulo sobre <a href="https://www.keopx.net/blog/instalar-certificados-de-lets-encrypt-free-ssltls-certificates-en-debian-ubuntu">Instalar certificados de Let's Encrypt - Free SSL/TLS Certificates en Debian / Ubuntu</a></p> <p>Este post es una revisión de que escribí.</p> <h1>Instalación</h1> <pre> <code class="language-bash"># apt-get install certbot</code></pre><h2>Configurar Apache</h2> <pre> <code class="language-bash"># nano /etc/apache2/sites-available/www.keopx.net-ssl.conf</code></pre><p>Y añadimos el <strong>-ssl</strong> por la existencia de un <strong><a href="https://github.com/certbot/certbot/issues/1042">bug</a></strong> en el <strong>certbot</strong>, que solo es capaz de distinguir un <strong>virtualhost</strong> por fichero <strong>*.conf</strong></p> <pre> <code class="language-bash">&lt;VirtualHost *:443&gt; ServerAdmin keopx@keopx.net ServerName www.keopx.net DocumentRoot /var/www/keopx.net/web &lt;Directory /var/www/keopx.net/web/&gt; Options FollowSymLinks AllowOverride All Require all granted &lt;/Directory&gt; ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On SSLCertificateFile /etc/letsencrypt/live/www.keopx.net/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.keopx.net/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf &lt;/VirtualHost&gt; </code></pre><h2>Creamos el SSL</h2> <pre> <code class="language-bash">certbot --apache -d www.keopx.net</code></pre><h2>Actualizamos los certificados</h2> <pre> <code class="language-bash">certbot renew --dry-run</code></pre><p>Referencias</p> <ul><li><a href="https://certbot.eff.org/docs/using.html#apache">https://certbot.eff.org/docs/using.html#apache</a></li> <li><a href="https://certbot.eff.org/docs/using.html?highlight=renew#renewing-certificates">https://certbot.eff.org/docs/using.html?highlight=renew#renewing-certif…</a></li> <li>Bug: <a href="https://github.com/certbot/certbot/issues/1042">https://github.com/certbot/certbot/issues/1042</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2017-09-02T12:34:20+02:00" title="Sábado, Septiembre 2, 2017 - 12:34">Sáb, 02/09/2017 - 12:34</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/letsencrypt" hreflang="es">letsencrypt</a></div> <div class="field__item"><a href="/categoria/seguridad" hreflang="es">Seguridad</a></div> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/debian-9" hreflang="es">Debian 9</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/debian-9" hreflang="es">Debian 9</a></div> <div class="field__item"><a href="/tag/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/tag/certbot" hreflang="es">certbot</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=292&amp;2=field_comments&amp;3=comment" token="e2q1tlu9gNjnsY9-OEPJORmF6R9X08tqdM22YQUr6Hk"></drupal-render-placeholder> </div> </div> </section> Sat, 02 Sep 2017 10:34:20 +0000 keopx 292 at https://keopx.net Cambiar el uid en Debian GNU/Linux https://keopx.net/blog/cambiar-el-uid-en-debian-gnulinux <span>Cambiar el uid en Debian GNU/Linux</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Hay necesidades de las más variadas, en este caso para conectar un NAS por NFS me fue necesario cambiar el uid de un usuario para que pudiese tener la acceso al recurso.</p> <p>Antes de realizar estos pasos es necesario que el usuario este deslogueado del sistema. Puede ser que el usuario root no este habilitado y el unico usuario que tengamos en el equipo sea un sudoer, para eso visitar el post anterior.</p> <p>Ver id del usuario:</p> <pre> # id keopx</pre><p>Cambiamos el uid:</p> <pre> # usermod -u 1002 keopx</pre><p>Comprobamos el nuevo id:</p> <pre> # id keopx</pre></div> <span><span>keopx</span></span> <span><time datetime="2012-01-26T18:56:28+01:00" title="Jueves, Enero 26, 2012 - 18:56">Jue, 26/01/2012 - 18:56</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=228&amp;2=field_comments&amp;3=comment" token="F017HooqnwYJ7sGxf8Bh8MKzpSkng0wENNKONQ8fG-k"></drupal-render-placeholder> </div> </div> </section> Thu, 26 Jan 2012 17:56:28 +0000 keopx 228 at https://keopx.net https://keopx.net/blog/cambiar-el-uid-en-debian-gnulinux#comments Instalación y configuración de SAI-UPS APC https://keopx.net/blog/instalacion-y-configuracion-de-sai-ups-apc <span>Instalación y configuración de SAI-UPS APC</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>En principio en gnome el servicio <strong>ups-monitor</strong> nos mantiene controlado el sistema SAI y nos permite configurarlo en caso de que la red eléctrica falle. <strong>Siempre que se haya iniciado una sesión en el equipo</strong>, de no ser así no mantendremos el control. Para solucionar esto en equipos servidor tenemos un paquete para esto, <strong>apcupsd</strong>:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo aptitude install apcupsd</pre><p>Cambiamos los parámetros en:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo cp /etc/apcupsd/apcupsd.conf /etc/apcupsd/apcupsd.conf.orig $ sudo nano /etc/apcupsd/apcupsd.conf</pre><p>Cambiamos</p> <pre line="1" lang="bash" xml:lang="bash">UPSCABLE smart</pre><p>Por</p> <pre line="1" lang="bash" xml:lang="bash">UPSCABLE usb</pre><p>Y más abajo tambien modificamos <em>UPSTYPE</em> y <em>DEVICE</em>: Cambiamos:</p> <pre line="1" lang="bash" xml:lang="bash">UPSTYPE apcsmart DEVICE /dev/ttys0</pre><p>Por:</p> <pre line="1" lang="bash" xml:lang="bash">UPSTYPE usb DEVICE</pre><p>* Si en <strong>DEVICE</strong> lo dejamos <strong>blanco</strong>. Resultado similar al siguiente:</p> <pre line="1" lang="bash" xml:lang="bash">## apcupsd.conf ## UPSNAME Back-900 UPSCABLE usb UPSTYPE usb DEVICE POLLTIME 60 LOCKFILE /var/lock</pre><p>Reiniciamos el servicio:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /etc/init.d/apcupsd restart</pre><p>Arrancamos el servicio a mano:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /sbin/apcupsd</pre><p>Probamos la configuración:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /sbin/apcaccess status</pre><p>Nos devolverá algo similar a esto:</p> <pre line="1" lang="bash" xml:lang="bash">APC : 001,037,0931 DATE : 2011-01-30 18:39:34 +0100 HOSTNAME : server-host VERSION : 3.14.8 (16 January 2010) debian UPSNAME : Back-900 CABLE : USB Cable MODEL : Back-UPS BR 900GI UPSMODE : Stand Alone STARTTIME: 2011-01-30 18:39:16 +0100 STATUS : ONLINE LINEV : 215.0 Volts LOADPCT : 27.0 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 37.2 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds SENSE : Medium LOTRANS : 176.0 Volts HITRANS : 294.0 Volts ALARMDEL : Always BATTV : 27.0 Volts LASTXFER : Unacceptable line voltage changes NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : NO STATFLAG : 0x07000008 Status Flag MANDATE : 2010-08-14 SERIALNO : 3B1022X43411 BATTDATE : 2010-08-14 NOMINV : 230 Volts NOMBATTV : 24.0 Volts NOMPOWER : 540 Watts FIRMWARE : 879.L1d.I USB FW:L1 APCMODEL : Back-UPS BR 900GI END APC : 2011-01-30 18:39:35 +0100</pre><p>Si reiniciamos nos encontraremos con el siguiente mensaje:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /sbin/apcaccess status Error contacting apcupsd @ localhost:3551: Connection refused</pre><p>Para que se inicia de forma automatica debemos cambiar el siguiente parametro:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo nano /etc/default/apcupsd</pre><p>Y dejamos así:</p> <pre line="1" lang="bash" xml:lang="bash"># Apcupsd-devel internal configuration APCACCESS=/sbin/apcaccess #ISCONFIGURED=no ISCONFIGURED=yes</pre><p><strong>Ya tenemos automatizado!!!</strong> Relacionados:</p> <ul><li><a href="http://flossexperiences.wordpress.com/2008/10/26/configuring-apcupsd/">http://flossexperiences.wordpress.com/2008/10/26/configuring-apcupsd/</a></li> <li><a href="http://failserver.nl/blog/2009/05/howto-install-apc-ups-750-series-on-debian-lenny/">http://failserver.nl/blog/2009/05/howto-install-apc-ups-750-series-on-debian-lenny/</a></li> <li><a href="http://www.imacat.idv.tw/cgi-bin/man/man2html?apcaccess+8">Explicación de las variables</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2011-01-31T18:11:36+01:00" title="Lunes, Enero 31, 2011 - 18:11">Lun, 31/01/2011 - 18:11</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/linux" hreflang="es">Linux</a></div> <div class="field__item"><a href="/tag/sai" hreflang="es">SAI</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> <div class="field__item"><a href="/tag/ups" hreflang="es">UPS</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=210&amp;2=field_comments&amp;3=comment" token="0PdQYdmavv6Ekq8vzUnpjZkd-Q2RC_Jerk5fA_ytrmw"></drupal-render-placeholder> </div> </div> </section> Mon, 31 Jan 2011 17:11:36 +0000 keopx 210 at https://keopx.net Carpetas chroot personalizadas para cada usuario https://keopx.net/blog/carpetas-chroot-personalizadas-para-cada-usuario <span>Carpetas chroot personalizadas para cada usuario</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Puede que nos interese el crear el más usuarios con sus carpetas chroot personalizadas.</p> <p>Para ello es necesario el modificar la siguiente linea:</p> <p><code>ChrootDirectory /var/www/web</code></p> <p>Por: <code>ChrootDirectory %h</code></p> <p>El %h es la carpeta personal de cada usuario que lo definimos al crear el usuario con la opción <em>-d</em>:</p> <p><code>sudo useradd -g sftponly -G sftponly -s /bin/false -d /var/www/web usuarioweb</code></p> <p>Ahora con cada usuario que creemos tendrá su propio chroot, sino se le define sera <em>/</em>.</p> <p>Relacionado con: <a href="http://www.keopx.net/blog/chroot-para-usuario-sftp/">http://www.keopx.net/blog/chroot-para-usuario-sftp/</a></p> </div> <span><span>keopx</span></span> <span><time datetime="2010-04-14T11:27:24+02:00" title="Miércoles, Abril 14, 2010 - 11:27">Mié, 14/04/2010 - 11:27</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> <div class="field__item"><a href="/tag/ssh" hreflang="es">ssh</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=174&amp;2=field_comments&amp;3=comment" token="A95ivxG9w_lY7OIuQkU_u78UKs6fu9fk7a_jaPdgZ6w"></drupal-render-placeholder> </div> </div> </section> Wed, 14 Apr 2010 09:27:24 +0000 keopx 174 at https://keopx.net https://keopx.net/blog/carpetas-chroot-personalizadas-para-cada-usuario#comments Chroot para usuario sftp https://keopx.net/blog/chroot-para-usuario-sftp <span>Chroot para usuario sftp</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Vamos a crear una especie de jaula para un usuario. Este usuario lo vamos a utilizar para un entorno web donde pueda subir ficheros y modificarlos, pero que no pueda salir de ese directorio.</p> <p>Lo primero es editar el fichero <em>/etc/ssh/sshd_config</em>:</p> <pre><code>sudo nano /etc/ssh/sshd_config</code> </pre><p>y al final lo dejamos así:</p> <pre><!--break--><code>#Subsystem sftp /usr/lib/openssh/sftp-server</code> <code>...</code> <code>UsePAM yes</code> <code>... Subsystem sftp internal-sftp</code> <code>Match group sftponly</code> <code>ForceCommand internal-sftp ChrootDirectory /var/www/web</code> </pre><p>Creamos la carpeta, con <em>usuario</em> y <em>grupo root</em> en la carpeta <em>/var/www/web</em>:</p> <pre><code>sudo mkdir /var/www/web</code> <code>drwxr-xr-x 5 root root 4,0K 2010-04-11 09:55 web</code> </pre><p>Dentro de <em>/var/www/web</em> pondremos los permisos que correspondan a los ficheros.</p> <pre>$ ls -lah total 260K drwxr-xr-x 5 root root 4,0K mar 22 12:28 . drwxr-xr-x 6 root root 4,0K mar 22 12:28 .. -rwxr-xr-x 1 usuarioweb www-data 3,9K mar 22 12:28 funciones.php -rwxr-xr-x 1 usuarioweb www-data 3,9K mar 22 12:28 insertar.php -rwxr-xr-x 1 usuarioweb www-data 3,3K mar 22 12:28 modificar.php </pre><p>Creamos el grupo sftponly:</p> <pre><code>sudo groupadd sftponly</code> </pre><p>Ahora creamos el usuario con el valor <em>-d</em> que sirve para definirle su directorio:</p> <pre><code>$ sudo useradd -g sftponly -G sftponly -s /bin/false -d /var/www/web usuarioweb</code> </pre><p>Le asignamos la contraseña oportuna:</p> <pre><code>$ sudo passwd usuarioweb</code> </pre><p>Reiniciamos el ssh:</p> <pre><code>$ sudo /etc/init.d/ssh restart</code> </pre><p>Ya tenemos nuestro directorio funcionando para que el <em>usuarioweb</em> no pueda salir de esa carpeta.</p> </div> <span><span>keopx</span></span> <span><time datetime="2010-04-13T10:57:22+02:00" title="Martes, Abril 13, 2010 - 10:57">Mar, 13/04/2010 - 10:57</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/linux" hreflang="es">Linux</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> <div class="field__item"><a href="/tag/ssh" hreflang="es">ssh</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=173&amp;2=field_comments&amp;3=comment" token="bpIHMb2TwPMM2e2IMKyeqvKTPqVXSn6kiBcaktrLMhk"></drupal-render-placeholder> </div> </div> </section> Tue, 13 Apr 2010 08:57:22 +0000 keopx 173 at https://keopx.net https://keopx.net/blog/chroot-para-usuario-sftp#comments Generar nuestro propio certificado SSL https://keopx.net/blog/generar-nuestro-propio-certificado-ssl <span>Generar nuestro propio certificado SSL</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Para generar un certificado valido (ejemplo web):</p> <pre line="1" lang="bash" xml:lang="bash">openssl req -nodes -new -keyout web.key -out web.csr</pre><!--break--><pre line="1" lang="bash" xml:lang="bash">keopx@prueba:/etc/apache2$ openssl req -nodes -new -keyout web.key -out web.csr Generating a 1024 bit RSA private key ...............................................++++++ ........................................................++++++ writing new private key to 'web.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:ES State or Province Name (full name) [Some-State]:Provincia Locality Name (eg, city) []:Localidad Organization Name (eg, company) [Internet Widgits Pty Ltd]:nombre_empresa Organizational Unit Name (eg, section) []:Sistemas Common Name (eg, YOUR name) []:www.web.com Email Address []:tu_usuario@web.com ----- Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: </pre><p><em>** Recordar que password y company name se han dejar en blanco.</em></p> <h3>Clave Privada</h3> <pre line="1" lang="bash" xml:lang="bash">cat web.key</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDa3jXaOMmjiNchcTNPIB56R8N2V+5HUosWcDh8xxHYP5K6XQ52 k+MvtIVg4K89/OhziyhaipgCkenEMmIrtoTT9fTGiQv0X93KjJwH/lvVUKdzBlVB hDWr405CCReeCEmA8vrUy7MTn718E7lKbqtyyJaW+YbimP0HogbK87gVAQIDAQAB AoGAU46aCKG9eU14tC+/YunkONLE8J1JPrlomDxnlFt7mI9MuRFlwCddiIzmjsG4 pXW0WMg7s7VNq02BbYG+sOmRc5VoBzj8G38yB8SpDj6QZgItkkYJMc9zKtMBf6IO nhY+FgRSUGvBWhLxn2oS3CC/oX9DwvdWvg8cHcD1G575oQECQQD5r4uWJqbR8UDw sQY4pyda6/qmLyWvMglok4vqcnXkjWOdngTL0woRstRHO5guY2eg7TSEX6wPtlQv BSkPsEcpAkEA4GcnDDyOEBkTtgVqjMozj5+DJLpZTFkbw/xfZj6saF45jHJ/EK2Y oi5R5UUHywb8uApHC6qIx/RYs9jH88ZSGQJAMZDpsusFXtP3wlBCHekA5QnHfkoJ vxe9ymbP9cC3KqHuzpFZ/mRssUrA3Us1ULAnGEk+jbC4ZX4ahCMQHa8u0QJAU9I0 I7360siLNFKRmkVtPRi4Q9/Xu00NsgdzGx4OCG4p0OxzyicN/IaQ0LMYVh4mCBjO sOzias460/MFvWk3AQJAfHsGbeltCyEhXkDxCKVQFmRVtsEZJARb+97u7rlqiIhS QVNUNqy7T6LXByoTOwbcG595k+6aqGjAq8oeyj96Yw== -----END RSA PRIVATE KEY-----</pre><h3>Certificado de envío</h3> <p>En caso de tener que enviar a una entidad certificadora (ej.: Verisign) les mandaremos este fichero:</p> <pre line="1" lang="bash" xml:lang="bash">cat web.csr</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN CERTIFICATE REQUEST----- MIIB3jCCAUcCAQAwgZ0xCzAJBgNVBAYTAkVTMRAwDgYDVQQIEwdCaXprYWlhMQ8w DQYDVQQHEwZCaWxiYW8xGTAXBgNVBAoTEEJpbGJvbWF0aWNhIFMuQS4xETAPBgNV BAsTCFNpc3RlbWFzMRQwEgYDVQQDEwt3d3cubWluZC5lczEnMCUGCSqGSIb3DQEJ ARYYcmVnaWd1cmVuQGJpbGJvbWF0aWNhLmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GN ADCBiQKBgQDa3jXaOMmjiNchcTNPIB56R8N2V+5HUosWcDh8xxHYP5K6XQ52k+Mv tIVg4K89/OhziyhaipgCkenEMmIrtoTT9fTGiQv0X93KjJwH/lvVUKdzBlVBhDWr 405CCReeCEmA8vrUy7MTn718E7lKbqtyyJaW+YbimP0HogbK87gVAQIDAQABoAAw DQYJKoZIhvcNAQEFBQADgYEAOQTnrUZ9VMyrHC+Tf2DC0pn6z1YSOpMjn5y7anvE CAdzL7C6CqLr21LNDmiSEov4Pq4oeyqPOYsbMsevp0x7JmvWwiQXkQnfJqR8zr5H E+pBSHHp1+Ydwx9T8/MAr3LtQhub7EkKpgEkpfmou43AwkMtshstB/c7JzZ0CQL/ Lu4= -----END CERTIFICATE REQUEST-----</pre><h3>Entidad certificadora</h3> <p>En caso de tener una central certificadora como puede ser Verisign, a la central certificadora le enviamos el web.csr para que no devuelva en fichero en texto plano web.crt (certificado).</p> <pre line="1" lang="bash" xml:lang="bash">cat web.crt</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN CERTIFICATE----- MIIE9jCCBF+gAwIBAgIQPQS2i9mi7QtNotD8uahBDTANBgkqhkiG9w0BAQUFADCB ujEfMB0GA1UEChMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazEXMBUGA1UECxMOVmVy aVNpZ24sIEluYy4xMzAxBgNVBAsTKlZlcmlTaWduIEludGVybmF0aW9uYWwgU2Vy dmVyIENBIC0gQ2xhc3MgMzFJMEcGA1UECxNAd3d3LnZlcmlzaWduLmNvbS9DUFMg SW5jb3JwLmJ5IFJlZi4gTElBQklMSVRZIExURC4oYyk5NyBWZXJpU2lnbjAeFw0w NzA2MDQwMDAwMDBaFw0wODA2MDQyMzU5NTlaMIIBBjELMAkGA1UEBhMCRVMxDzAN BgNVBAgTBk1hZHJpZDEPMA0GA1UEBxQGTWFkcmlkMSUwIwYDVQQKFBxIaWdoIFRl Y2ggSG90ZWxzIEFORCBSZXNvcnRzMREwDwYDVQQLFAhTaXN0ZW1hczEyMDAGA1UE CxMpVGVybXMgb2YgdXNlIGF0IHd3dy52ZXJpc2lnbi5lcy9ycGEgKGMpMDUxIjAg BgNVBAsTGUF1dGhlbnRpY2F0ZWQgYnkgVmVyaVNpZ24xJzAlBgNVBAsTHk1lbWJl ciwgVmVyaVNpZ24gVHJ1c3QgTmV0d29yazEaMBgGA1UEAxQRd3d3Lmh0aG90ZWxl cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL6R3vYaeb2r70/m3ffP YZnyBmRoEfZXWQtICQRd6EqIGbtIu9Ftflcw5e+5KKgHqTp7d5VX07mTN9aV2rEs bgBaSKEH9NpeaMaUGxLdI/A9oO7RWPs+gC4YIozfo6Zp4R7H7A8YohtDdzDVigCj 1xgu7NqpvXk2rIRPoB1f69gvAgMBAAGjggGsMIIBqDAJBgNVHRMEAjAAMAsGA1Ud DwQEAwIFoDBDBgNVHSAEPDA6MDgGC2CGSAGG+EUBBxcDMCkwJwYIKwYBBQUHAgEW G2h0dHBzOi8vd3d3LnZlcmlzaWduLmVzL3JwYTA8BgNVHR8ENTAzMDGgL6Athito dHRwOi8vU1ZSSW50bC1jcmwudmVyaXNpZ24uY29tL1NWUkludGwuY3JsMCgGA1Ud JQQhMB8GCCsGAQUFBwMBBggrBgEFBQcDAgYJYIZIAYb4QgQBMHEGCCsGAQUFBwEB BGUwYzAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AudmVyaXNpZ24uY29tMDsGCCsG AQUFBzAChi9odHRwOi8vU1ZSSW50bC1haWEudmVyaXNpZ24uY29tL1NWUkludGwt YWlhLmNlcjBuBggrBgEFBQcBDARiMGChXqBcMFowWDBWFglpbWFnZS9naWYwITAf MAcGBSsOAwIaBBRLa7kolgYMu9BSOJsprEsHiyEFGDAmFiRodHRwOi8vbG9nby52 ZXJpc2lnbi5jb20vdnNsb2dvMS5naWYwDQYJKoZIhvcNAQEFBQADgYEAB3n9wQMS erbvDAUyFyPqqGOVeSATrXcNU2IMcmZobWhi284wwT96eS5K2H0r3eGGGUOsfgyh gsJIw2Hj90l1eQwnNg0L0XZQU2tLy/x6+ZYuIX4yJq9De2p9SK9BOZuXHcjFYOA/ CaQ3KkqTjeX7ozOn9BLqvFxtuwzxt8qNOPA= -----END CERTIFICATE-----</pre><h3>Auto certificarse</h3> <p>En este caso no tener una entidad certificadora (la mayoría de casos), nos auto certificaremos.</p> <pre line="1" lang="bash" xml:lang="bash">openssl x509 -in web.csr -out web.crt -req -signkey web.key -days 365</pre><pre line="1" lang="bash" xml:lang="bash">keopx@prueba:/etc/apache2$ openssl x509 -in web.csr -out web.crt -req -signkey web.key -days 365 Signature ok subject=/C=ES/ST=Provincia/L=Localidad/O=nombre_empresa./OU=Sistemas/CN=www.web.com/emailAddress=tu_usuario@web.com Getting Private key </pre><pre line="1" lang="bash" xml:lang="bash">cat web.crt</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN CERTIFICATE----- MIICszCCAhwCCQCGFBuLiz/tCjANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMC RVMxEDAOBgNVBAgTB0JpemthaWExDzANBgNVBAcTBkJpbGJhbzEZMBcGA1UEChMQ QmlsYm9tYXRpY2EgUy5BLjERMA8GA1UECxMIU2lzdGVtYXMxFDASBgNVBAMTC3d3 dy5taW5kLmVzMScwJQYJKoZIhvcNAQkBFhhyZWdpZ3VyZW5AYmlsYm9tYXRpY2Eu ZXMwHhcNMDkwOTE2MDk1NjU4WhcNMTAwOTE2MDk1NjU4WjCBnTELMAkGA1UEBhMC RVMxEDAOBgNVBAgTB0JpemthaWExDzANBgNVBAcTBkJpbGJhbzEZMBcGA1UEChMQ QmlsYm9tYXRpY2EgUy5BLjERMA8GA1UECxMIU2lzdGVtYXMxFDASBgNVBAMTC3d3 dy5taW5kLmVzMScwJQYJKoZIhvcNAQkBFhhyZWdpZ3VyZW5AYmlsYm9tYXRpY2Eu ZXMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANreNdo4yaOI1yFxM08gHnpH w3ZX7kdSixZwOHzHEdg/krpdDnaT4y+0hWDgrz386HOLKFqKmAKR6cQyYiu2hNP1 9MaJC/Rf3cqMnAf+W9VQp3MGVUGENavjTkIJF54ISYDy+tTLsxOfvXwTuUpuq3LI lpb5huKY/QeiBsrzuBUBAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAHgPnvRvflNon f+ZxPi+G/foTrrhFgsKZbxza7if1lZgNzBarC+p4wISjxqMfjz5xbuMV6c4dKWv1 KvqsXTbUtqVV4ATsNWHCYCxS9j+rBI0n9ADJTLF4Y2B7cUwdEL1xLDjgbSh5nlNG ylI6XAuDZGQyqRJZlEPFyGBb0Cq6bdg= -----END CERTIFICATE-----</pre><h3>Instalar certificado en el servidor</h3> <p>Copias los ficheros web.crt y web.key a la ruta correspondiente:</p> <pre line="1" lang="bash" xml:lang="bash">sudo mv web.crt /etc/ssl/certs/web.crt sudo mv web.key /etc/ssl/private/web.key</pre><p>Esto dependerá del tipo servidor, una vez instalado procedemos a reiniciar. Se reinicia el servidor y están operativas. <em>** Las rutas y forma de instalar dependerán del tipo del server. </em></p> <h3>Otras opciones</h3> <p>Vamos a ver otras posibilidades Ver datos de un certificado:</p> <pre line="1" lang="bash" xml:lang="bash">openssl req -in web.csr -noout -text</pre><p>Certificado con RSA de 2048 bits</p> <pre line="1" lang="bash" xml:lang="bash">openssl req -nodes -new -keyout web.key -out web.csr -newkey rsa:2048</pre></div> <span><span>keopx</span></span> <span><time datetime="2009-10-23T18:58:31+02:00" title="Viernes, Octubre 23, 2009 - 18:58">Vie, 23/10/2009 - 18:58</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=137&amp;2=field_comments&amp;3=comment" token="uVXLDbljN_nJV8oqK3Zyx-W6WnpdvnuqRgDxTXyHI-E"></drupal-render-placeholder> </div> </div> </section> Fri, 23 Oct 2009 16:58:31 +0000 keopx 137 at https://keopx.net Recuperar contrseña de root de MySQL https://keopx.net/blog/recuperar-contrsena-de-root-de-mysql <span>Recuperar contrseña de root de MySQL</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Bueno en este post vamos a recuperar la password de root de MySQL.</p> <p>Lo primero es para nuestra mysql:</p> <p><strong>sudo /etc/init.d/mysql stop</strong></p> <p>Y reiniciamos sin la password de la siguiente manera:</p> <p><code>sudo mysqld_safe –skip-grant-tables &amp;</code></p> <p>Puede que nos salga alguna salida extraña, ahora le damos al <strong>Enter</strong> y escribimos:</p> <p><code>mysql -u root</code></p> <p>Seleccionamos la BBDD:</p> <p><code>mysql&gt; use mysql;</code></p> <p>Añadimos la nueva password:</p> <p><code>mysql&gt; update user set password=PASSWORD(”nueva_password) where User=’root’;</code></p> <p>Refrescamos los permisos:</p> <p><code>mysql&gt; flush privileges;</code></p> <p>Salimos:</p> <p><code>mysql&gt; quit</code></p> <p>Reiniciamos:</p> <p><code>sudo /etc/init.d/mysql restart</code></p> <section data-quickedit-field-id="node/128/field_comments/es/full"> </section></div> <span><span>keopx</span></span> <span><time datetime="2009-09-22T11:00:06+02:00" title="Martes, Septiembre 22, 2009 - 11:00">Mar, 22/09/2009 - 11:00</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/mysql" hreflang="es">MySQL</a></div> <div class="field__item"><a href="/categoria/seguridad" hreflang="es">Seguridad</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/base-de-datos" hreflang="es">Base de datos</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/mysql" hreflang="es">Mysql</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=128&amp;2=field_comments&amp;3=comment" token="R13KWaWl3ERr_YslIKNlz9jmMhQrKx_nUzjofMwMRMc"></drupal-render-placeholder> </div> </div> </section> Tue, 22 Sep 2009 09:00:06 +0000 keopx 128 at https://keopx.net https://keopx.net/blog/recuperar-contrsena-de-root-de-mysql#comments Recuperar contrseña de root de nuestra maquina en GNU/Linux https://keopx.net/blog/recuperar-contrsena-de-root-de-nuestra-maquina-en-gnulinux <span>Recuperar contrseña de root de nuestra maquina en GNU/Linux</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>on unos sencillos pasos que nos ayudaran a recuperar la password (root) de nuestra maquina.</p> <p>Antes de nada tendremos que iniciar la maquina en <strong>single mode</strong>. Para ello en la pantalla del grub elegimos esa opción, en caso de tenerla deberemos editar la que tenemos.</p> <p>Le damos a la <strong>e</strong> vamos al final y escribimos <strong>linux single</strong> una vez echo eso le damos a la <strong>b</strong> para que inicie. Este cambio solo es temporal en el siguiente inicio no estará.</p> <p>Empezamos con la consola:</p> <p><code>nano /etc/passwd</code></p> <p>Dejamos la <strong>root</strong> que sera así:</p> <p><code>root:x:0:0:root:/root:/bin/bash</code></p> <p>Y eliminamos la <strong>x</strong> dejándolo así:</p> <p><strong>root::0:0:root:/root:/bin/bash</strong></p> <p>Guardamos el fichero y modificamos el <strong>/etc/shadow</strong>:</p> <p><code>nano /etc/shadow</code></p> <p>Editamos la linea que tiene <strong>root</strong> y la dejaremos con 4 <strong>:</strong> así:</p> <p><code>root::::</code></p> <p>Guardamos los cambios.</p> <p>Reiniciamos la maquina de forma normal, accedemos y vamos a la consola. Ahora no stoca poner la nueva password:</p> <p><code>su<br /> passwd</code></p> <p>Ahora ya tendremos la nueva password funcionando.</p> </div> <span><span>keopx</span></span> <span><time datetime="2009-09-21T10:59:05+02:00" title="Lunes, Septiembre 21, 2009 - 10:59">Lun, 21/09/2009 - 10:59</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/seguridad" hreflang="es">Seguridad</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/password" hreflang="es">password</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=127&amp;2=field_comments&amp;3=comment" token="3euFzAmiBkTmzzMT_CNEfmokkKmp6rDNryAl8EU6dlc"></drupal-render-placeholder> </div> </div> </section> Mon, 21 Sep 2009 08:59:05 +0000 keopx 127 at https://keopx.net https://keopx.net/blog/recuperar-contrsena-de-root-de-nuestra-maquina-en-gnulinux#comments Crear claves GPG en GNU/Linux https://keopx.net/blog/crear-claves-gpg-en-gnulinux <span>Crear claves GPG en GNU/Linux</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Vamos a crear un par de claves GPG. Lo realizaremos en la consola aunque también se puede realizar "Contraseñas y claves de cifrado".</p> <h3>Creación de clave</h3> <p><code>gpg --gen-key</code></p> <p>Elegir, eso si tener en cuenta que la clave que se utilice hará que sea mas robusta ante un ataque por fuerza bruta por eso mínimo de 8 caracteres de todo tipo, mayúsculas, minúsculas, numérico...</p> <p><code>Por favor seleccione tipo de clave deseado:<br /> (1) DSA y ElGamal (por defecto)<br /> (2) DSA (sólo firmar)<br /> (5) RSA (sólo firmar)<br /> ¿Su elección?: 1</code></p> <p><code>El par de claves DSA tendrá 1024 bits.<br /> las claves ELG-E pueden tener entre 1024 y 4096 bits de longitud.<br /> ¿De qué tamaño quiere la clave? (2048) 4096</code></p> <p><code>El tamaño requerido es de 4096 bits<br /> Por favor, especifique el período de validez de la clave.<br /> 0 = la clave nunca caduca<br /> = la clave caduca en n días<br /> w = la clave caduca en n semanas<br /> m = la clave caduca en n meses<br /> y = la clave caduca en n años<br /> ¿Validez de la clave (0)? 0<br /> Key does not expire at all<br /> nunca caduca<br /> ¿Es correcto (s/n)? s</code></p> <p>Ya tenemos la clave eso si nos pedirá que realicemos tareas para recoger info aleatoria para generar la clave.</p> <h3>Listar las claves</h3> <p><code>gpg --list-keys</code></p> <h3>Clave de revocación</h3> <p>Esto es necesario ya que si algún día queremos eliminar la clave por cualquier motivo sin esto sera imposible.</p> <p><code>gpg --output nombre_revoke.asc --gen-revoke tu_email@email.com</code></p> <p><code>¿Crear un certificado de revocación para esta clave? s<br /> Por favor elija una razón para la revocación:<br /> 0 = No se dio ninguna razón<br /> 1 = La clave ha sido comprometida<br /> 2 = La clave ha sido reemplazada.<br /> 3 = La clave ya no está en uso<br /> Q = Cancelar</code></p> <p>Te pedirá el contraseña.</p> <h3>Clave privada completa</h3> <p><code>gpg --output miclave_privada_sec.asc --armor --export-secret-key tu_email@email.com</code></p> <h3>Clave publica</h3> <p><code>gpg -a --export tu_email@email.com &gt; miclave_publica.asc</code></p> <h3>Exportar clave publica al servidor</h3> <p>Antes de nada tenemos que elegir un:</p> <ul><li>hkp://keyserver.ubuntu.com:11371</li> <li>hkp://pgp.mit.edu:11371</li> <li>ldap://keyserver.pgp.com</li> <li>pgp.rediris.es</li> </ul><p><code>gpg --keyserver pgp.rediris.es --send-keys tu_email@email.com</code></p> <p>Referencia:</p> <ul><li><a href="http://www.gnupg.org/gph/es/manual.html#AEN27">http://www.gnupg.org/gph/es/manual.html#AEN27</a></li> <li><a href="http://www.versvs.net/anotacion/como-por-que-usar-cifrado-correo-tutorial-apto-para-novatos">http://www.versvs.net/anotacion/como-por-que-usar-cifrado-correo-tutorial-apto-para-novatos</a></li> </ul><p> </p> </div> <span><span>keopx</span></span> <span><time datetime="2009-07-04T19:04:33+02:00" title="Sábado, Julio 4, 2009 - 19:04">Sáb, 04/07/2009 - 19:04</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/gpg" hreflang="es">GPG</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/seguridad" hreflang="es">Seguridad</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/gpg" hreflang="es">GPG</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=106&amp;2=field_comments&amp;3=comment" token="1Sqj-gEQpJsfb8ZexSEiLfPM54HovMLW3aGAcq1HoLo"></drupal-render-placeholder> </div> </div> </section> Sat, 04 Jul 2009 17:04:33 +0000 keopx 106 at https://keopx.net https://keopx.net/blog/crear-claves-gpg-en-gnulinux#comments