Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Següent revisió | Revisió prèvia | ||
| linux:ssh:config [10/02/2016 08:41] – creado mate | linux:ssh:config [07/05/2025 05:07] (actual) – [configuración ssh server (/etc/ssh/sshd_config)] mate | ||
|---|---|---|---|
| Línia 1: | Línia 1: | ||
| - | = configuración | + | = configuración |
| - | + | | |
| - | comprobar si hay restricciones en IPTABLES | + | |
| - | + | * Opciones destacadas: | |
| - | se puede limitar el uso que se puede hacer de SSH en el siguiente fichero:''/ | + | * **Protocol 2** |
| - | * //Protocol 2// | + | * **PermitRootLogin** {yes|no|forced-commands-only} |
| - | | + | * **PasswordAuthentication** {yes|no}: uso o no de contraseña (forzar uso de keys) |
| - | | + | * **IgnoreRhosts** {yes|no} evita la lectura de los ficheros ~/.rhosts y ~/.shosts |
| - | * //PermitRootLogin// {yes|no|forced-commands-only} | + | |
| - | * //IgnoreRhosts// {yes|no} evita la lectura de los ficheros ~/.rhosts y ~/.shosts | + | * **Port 22** |
| - | * // | + | * **ListenAddress 192.168.1.1** |
| - | | + | * **PermitEmptyPasswords** {yes|no} |
| - | * //Port 22// | + | * **ClientAliveInterval < |
| - | * //ListenAddress 192.168.1.1// | + | * **ClientAliveCountMax <#>** número de veces que comprueba actividad, según intervalo de **ClientAliveInterval** |
| - | * //PermitEmptyPasswords// {yes|no} | + | * **LogLevel INFO** |
| - | * //LogLevel INFO// | + | * **AllowUsers** solo los usuarios que se pueden conectar vía SSH |
| - | * AllowGroups | + | * **DenyUsers** a los usuarios que NO se pueden conectar vía SSH |
| - | * DenyGroups | + | |
| + | * DenyGroups | ||
| + | * curso lpic2: [[info: | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | |||
| + | == restricciones | ||
| + | === agent forwarding | ||
| + | <code ; / | ||
| + | Match User that-restricted-guy | ||
| + | AllowTcpForwarding yes | ||
| + | X11Forwarding no | ||
| + | AllowAgentForwarding no | ||
| + | ForceCommand /bin/false | ||
| + | </ | ||
| + | <code ; / | ||
| + | Match User even-more-restricted-guy | ||
| + | PermitOpen 127.0.0.1: | ||
| + | X11Forwarding no | ||
| + | AllowAgentForwarding no | ||
| + | ForceCommand /bin/false | ||
| + | </ | ||
| + | * Solo permite forward de conexiones a 127.0.0.1 | ||
| + | * para evitar la desconexión y mantener la conexión de reenvio abierta, deberá usar **-N** en su conexión **ssh**:< | ||
| + | <code ; / | ||
| + | Match Group | ||
| + | PubkeyAuthentication | ||
| + | PasswordAuthentication | ||
| + | PermitEmptyPasswords | ||
| + | GatewayPorts | ||
| + | ChrootDirectory | ||
| + | ForceCommand | ||
| + | AllowTcpForwarding | ||
| + | PermitOpen | ||
| + | PermitOpen | ||
| + | # Or leave out the PermitOpen to allow forwarding to anywhere. | ||
| + | HostbasedAuthentication | ||
| + | RhostsRSAAuthentication | ||
| + | AllowAgentForwarding | ||
| + | Banner | ||
| + | </ | ||
| + | Restringir acceso a la red:< | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | /via: [[https:// | ||
| + | /more: [[https:// | ||