Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
linux:installation:ssh [2022/09/03 12:36] – tutospisto | linux:installation:ssh [2022/09/03 12:50] (Version actuelle) – tutospisto | ||
---|---|---|---|
Ligne 8: | Ligne 8: | ||
<code bash> | <code bash> | ||
- | Il faut éditer les lignes suivantes ( 8, 76, 79 et 98 du fichier dispo ici : sshd_config.txt ) : | + | Il faut éditer les lignes suivantes ( 8, 76, 79 et 98 du fichier dispo ici : <file bash sshd_config.txt[enable_line_numbers=1, |
+ | # Lignes a modifier : 8, 77, 80, 90 | ||
+ | |||
+ | |||
+ | # Package generated configuration file | ||
+ | # See the sshd_config(5) manpage for details | ||
+ | |||
+ | # What ports, IPs and protocols we listen for | ||
+ | Port TON_PORT | ||
+ | |||
+ | # Use these options to restrict which interfaces/ | ||
+ | # | ||
+ | # | ||
+ | Protocol 2 | ||
+ | # HostKeys for protocol version 2 | ||
+ | HostKey / | ||
+ | HostKey / | ||
+ | #Privilege Separation is turned on for security | ||
+ | UsePrivilegeSeparation yes | ||
+ | |||
+ | # Lifetime and size of ephemeral version 1 server key | ||
+ | KeyRegenerationInterval 3600 | ||
+ | ServerKeyBits 768 | ||
+ | |||
+ | # Logging | ||
+ | SyslogFacility AUTH | ||
+ | LogLevel INFO | ||
+ | |||
+ | # Authentication: | ||
+ | LoginGraceTime 120 | ||
+ | PermitRootLogin no | ||
+ | StrictModes yes | ||
+ | |||
+ | RSAAuthentication yes | ||
+ | PubkeyAuthentication yes | ||
+ | # | ||
+ | |||
+ | # Don't read the user's ~/.rhosts and ~/.shosts files | ||
+ | IgnoreRhosts yes | ||
+ | # For this to work you will also need host keys in / | ||
+ | RhostsRSAAuthentication no | ||
+ | # similar for protocol version 2 | ||
+ | HostbasedAuthentication no | ||
+ | # Uncomment if you don't trust ~/ | ||
+ | # | ||
+ | |||
+ | # To enable empty passwords, change to yes (NOT RECOMMENDED) | ||
+ | PermitEmptyPasswords no | ||
+ | |||
+ | # Change to yes to enable challenge-response passwords (beware issues with | ||
+ | # some PAM modules and threads) | ||
+ | ChallengeResponseAuthentication no | ||
+ | |||
+ | # Change to no to disable tunnelled clear text passwords | ||
+ | # | ||
+ | |||
+ | # Kerberos options | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # GSSAPI options | ||
+ | # | ||
+ | # | ||
+ | |||
+ | X11Forwarding yes | ||
+ | X11DisplayOffset 10 | ||
+ | PrintMotd no | ||
+ | PrintLastLog yes | ||
+ | TCPKeepAlive yes | ||
+ | #UseLogin no | ||
+ | |||
+ | # Explications a partir de 3 mauvaises connexions le client a 30% de chances de s'en voir refuser une nouvelle | ||
+ | # Cette probabilite augmente lineairement jusqu' | ||
+ | # a partir de 60 connexions il ne pourra plus se connecter | ||
+ | MaxStartups 3:30:60 | ||
+ | |||
+ | # Permet d' | ||
+ | Banner / | ||
+ | |||
+ | # Allow client to pass locale environment variables | ||
+ | AcceptEnv LANG LC_* | ||
+ | |||
+ | Subsystem sftp / | ||
+ | |||
+ | # Set this to ' | ||
+ | # and session processing. If this is enabled, PAM authentication will | ||
+ | # be allowed through the ChallengeResponseAuthentication and | ||
+ | # PasswordAuthentication. | ||
+ | # PAM authentication via ChallengeResponseAuthentication may bypass | ||
+ | # the setting of " | ||
+ | # If you just want the PAM account and session checks to run without | ||
+ | # PAM authentication, | ||
+ | # and ChallengeResponseAuthentication to ' | ||
+ | UsePAM yes | ||
+ | |||
+ | # Securise les connexions en specifiant une liste des users authorises a se connecter | ||
+ | AllowUsers PSEUDO_USER1 PSEUDO_USER2</ | ||
Ligne 14: | Ligne 112: | ||
<code bash [enable_line_numbers=1, | <code bash [enable_line_numbers=1, | ||
- | A partir de 3 mauvaises connexions le client a 30% de chances de s’en voir refuser une nouvelle. Cette probabilité augmente linéairement jusqu’à 60 connexions. A partir de 60 connexions il ne pourra plus se connecter. | + | A partir de 3 mauvaises connexions le client a 30% de chances de s’en voir refuser une nouvelle.\\ |
+ | Cette probabilité augmente linéairement jusqu’à 60 connexions.\\ | ||
+ | A partir de 60 connexions il ne pourra plus se connecter. | ||
<code bash [enable_line_numbers=1, | <code bash [enable_line_numbers=1, | ||