[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Próxima revisión
Revisión previa
Próxima revisiónAmbos lados, revisión siguiente
es:howtos:security:ssh [2019/02/11 01:44 (UTC)] – creado slackwarespanoles:howtos:security:ssh [2019/03/24 16:12 (UTC)] – [Alternate method of Changing the SSH default port without changing] antares_alf
Línea 1: Línea 1:
 <!-- Add your text below. Start with a Headline (see button bar above). --> <!-- Add your text below. Start with a Headline (see button bar above). -->
-====== Improving OpenSSH security ======+====== Mejorando la seguridad de OpenSSH ======
  
-[[http://www.openssh.org|OpenSSH]] is the swiss-army knife of remote-access programsit provides you with a shell on your distant machineand transmits data in a secure and encrypted way including commandsfile transfer, X11 and VNC sessions, rsync data, etc.+[[http://www.openssh.org|OpenSSH]] es la navaja suiza de los programas de acceso remotole proporciona un shell en su máquina distante,y transmite datos de forma segura y encriptada  incluyendo comandostransferencia de archivossesiones X11 VNC, datos rsync, etc.
  
-[[http://www.openssh.org|OpenSSH]] is so advanced that it can be considered as a simplified VPN (Virtual Private Network). +[[http://www.openssh.org|OpenSSH]]es tan avanzado que puede considerarse como una VPN simplificada (red privada virtual). 
  
-Slackware contains [[http://www.openssh.org|OpenSSH]] of courseand the default configuration is already pretty secureThis page has been created to show you few simple configuration tweaks that can be applied to the default configuration to improve its security.+Slackware contiene [[http://www.openssh.org|OpenSSH]]por supuestoy la configuración por defecto ya es bastante segura.Esta página se ha creado para mostrarle algunos ajustes de configuración simples que se pueden aplicar la configuración predeterminada para mejorar su seguridad.
  
-You will need to know how to use a text editor to be able to follow this HOWTO. If you are a complete beginnertry ''nano''Once you are more advanced, and more at ease with Linux, feel free to use something more powerful...+Necesitará saber cómo usar un editor de texto para poder seguir este HOWTO. Si eres un principiante completoprueba ''nano''.Una vez que esté más avanzado y más cómodo con Linux, siéntase libre de usar algo más poderoso ...
  
-===== The SSH configuration files and finding more information =====+===== Los archivos de configuración de SSH y encontrar más información =====
  
-The [[http://www.openssh.org|OpenSSH]] configuration files reside in the directory ''/etc/ssh/''The most important one is the ''/etc/ssh/sshd_config'' that we are going to modify here.+Los archivos de configuración de [[http://www.openssh.org|OpenSSH]] residen en el directorio''/etc/ssh/''El más importante es el ''/etc/ssh/sshd_config'' que vamos a modificar aquí.
  
-The [[http://www.openssh.org|OpenSSH]] documentation is very goodso feel free to enter the command: ''apropos openssh'' or ''man -k openssh'' and read the different man pageswhich are much more detailed than this wiki page.+La documentación de [[http://www.openssh.org|OpenSSH]] es muy buenaasí que siéntase libre de ingresar el comando: ''apropos openssh'' or ''man -k openssh'' y lea las diferentes páginas man, que son mucho más detalladas que esta página wiki. 
 +===== Modificando el archivo sshd_config =====
  
-===== Modifying the sshd_config file =====+La primera regla, antes de modificar un archivo de configuración importante es hacer una copia de respaldo. Por ejemplo:
  
 +<code>
 +# cp -v /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG.20120826
 +</code>
  
-The first rulebefore you modify an important configuration file is to make backup copy of itFor instance:+El comando mostrado arriba hace una copia del archivo ''sshd_config'' y añadir la extención ''.ORIG'' (por original, por supuesto)e incluir la fecha de modificación. Aunque no es perfectoeste sistema asegurar que siempre pueda volver la versión previa del importante archivo ingresando el siguiente código.
  
-''# cp -v /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG.20120826''+<code> 
 +# cp -v /etc/ssh/sshd_config.ORIG.20120826 /etc/ssh/sshd_config 
 +</code>
  
-The command shown above will make a copy of the ''sshd_config'' fileand append the extension ''.ORIG'' (for originalof course) and include modification date. While not perfectthis system insures that you can always go back to the previous version of an important file by entering the following:+Tenga en cuenta que esta es una sugerenciapor supuestoy se recomienda encarecidamente los administradores de sistemas que tienen que administrar grandes instalacionescon cientos de servidores, investigar mejores soluciones, como [[http://puppetlabs.com/|Puppet]] u otros gestores de configuración de sistemas distribuidos.
  
-''# cp -v /etc/ssh/sshd_config.ORIG.20120826 /etc/ssh/sshd_config''+Ahora, edite el archivo ''/etc/ssh/sshd_config'' con su editor favorito y ajusta las siguientes lineas:
  
-Please note that this is suggestionof courseand system administrators that have to manage large installationwith hundreds of serversare strongly advised to investigate better solutions, such as [[http://puppetlabs.com/|Puppet]] or other distributed system configuration managers.+===== Cambiar el puerto predeterminado de SSH ===== 
 +Por defecto, OpenSSH escucha en el puerto ''22''. A veces se recomienda cambiar este puerto predeterminado algo diferentecomo ''2222'' o ''4242''. Esto no es una mala ideapero debe recordar que al escanear su máquina con un programa como ''nmap'' obtendrá este nuevo puerto muy rápidamente.Por lo tantosi bien puede ralentizar algunos ataques en su máquinano los evitará por completo.
  
-Nowedit the ''/etc/ssh/sshd_config'' file with your favourite editor and tweak the following lines:+Si desea cambiar el puertobusque la opción ''Port'' en ''sshd_config'', que generalmente está en la parte superior del archivo, y cambie el valor.
  
-===== Change the SSH default port ===== +Por ejemplo:
- +
-By default, OpenSSH listens on port 22. It is sometimes advised to change this default port to something different, such as ''2222'' or ''4242''. This is not a bad idea, but you have to remember that scanning your machine with a program such as ''nmap'' will obtain this new port very quickly. So, while it may slow down some attacks on your machine, it will not prevent them entirely. +
- +
-If you'd like to change the port, search for the ''Port'' option in ''sshd_config'', which is usually at the top of file, and change the value. +
- +
-For instance:+
  
 ''Port 22'' ''Port 22''
  
-Can be changed to:+Puede cambiarse por:
  
 ''Port 4242'' ''Port 4242''
 +===== Método alternativo para cambiar el puerto predeterminado de SSH sin cambiarlo =====
  
 +Esta sugerencia es completamente sacada de otro sitio. [[http://null.redcodenetwork.ro/changing-the-ssh-port-without-changing-it/|redcodenetwork.ro]]
 +La idea aquí es agregar una llamada a este script en ''rc.local'' para que se ejecute al inicio.
  
-===== Alternate method of Changing the SSH default port without changing  ===== +Para usar el ejemplo de descarga en la parte inferior, cámbielo su gusto y guárdelo en ''/etc/rc.d/'' (haga que sea ejecutable
- +Agregue este ejemplo a continuación a ''/etc/rc.d/rc.local
-This suggestion is completely lifted from another site [[http://null.redcodenetwork.ro/changing-the-ssh-port-without-changing-it/]] +
- The idea here is add call to this script in rc.local so it will run at start up. +
- +
-To use Download sample at the bottom change as you like and save it in /etc/rc.d/  (make it executable to use+
-Add this sample below to /etc/rc.d/rc.local+
  
-#add ssh_hide to port 8889+#Agregar ssh_hide al puerto 8889
   if [ -x /etc/rc.d/rc.ssh_hide ]; then   if [ -x /etc/rc.d/rc.ssh_hide ]; then
     /etc/rc.d/rc.ssh_hide     /etc/rc.d/rc.ssh_hide
 es:howtos:security:ssh ()