Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia | ||
linux:ssh:config [23/03/2021 10:31] – mate | linux:ssh:config [22/11/2023 02:40] (actual) – [configuración ssh server (/etc/ssh/sshd_config)] mate | ||
---|---|---|---|
Línia 1: | Línia 1: | ||
= configuración ssh server (/ | = configuración ssh server (/ | ||
- | + | * comprobar si hay restricciones en IPTABLES ''/ | |
- | 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// | + | * **AllowUsers** solo los usuarios que se pueden conectar vía SSH |
- | * //AllowUsers// solo los usuarios que se pueden conectar vía SSH | + | * **DenyUsers** a los usuarios que NO se pueden conectar vía SSH |
- | * //DenyUsers// a los usuarios que NO se pueden conectar vía SSH | + | * **PermitRootLogin** {yes|no|forced-commands-only} |
- | * //PermitRootLogin// {yes|no|forced-commands-only} | + | * **IgnoreRhosts** {yes|no} evita la lectura de los ficheros ~/.rhosts y ~/.shosts |
- | * //IgnoreRhosts// {yes|no} evita la lectura de los ficheros ~/.rhosts y ~/.shosts | + | * **PermitRootLogin** {yes|no} |
- | * //PermitRootLogin// {yes|no} | + | * **Banner** / |
- | * //Banner// / | + | * **Port 22** |
- | * //Port 22// | + | * **ListenAddress 192.168.1.1** |
- | * //ListenAddress 192.168.1.1// | + | * **PermitEmptyPasswords** {yes|no} |
- | * //PermitEmptyPasswords// {yes|no} | + | * **LogLevel INFO** |
- | * //LogLevel INFO// | + | * AllowGroups |
- | * AllowGroups | + | * DenyGroups |
- | * DenyGroups | + | |
* curso lpic2: [[info: | * curso lpic2: [[info: | ||
Línia 23: | Línia 22: | ||
* [[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:// |