informatique:reseau:ssh
Différences
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 | ||
| informatique:reseau:ssh [24/01/2025 10:51] – [Proxying] cyrille | informatique:reseau:ssh [21/06/2026 08:01] (Version actuelle) – [Configuration] cyrille | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Secure SHell (SSH) ====== | ====== Secure SHell (SSH) ====== | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | Guides pour configurer et durcir ssh: | ||
| + | - https:// | ||
| + | - https:// | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| + | |||
| + | Afficher et tester la configuration complète (variables config & default) : | ||
| + | |||
| + | < | ||
| + | # Afficher et tester | ||
| + | sudo sshd -T | ||
| + | # Juste tester | ||
| + | sudo sshd -t | ||
| + | </ | ||
| Dans / | Dans / | ||
| Ligne 17: | Ligne 32: | ||
| </ | </ | ||
| - | Mais bon ça marche pas … | + | Une configuration solide: |
| - | + | ||
| - | Voici une config qui fontionne | + | |
| < | < | ||
| - | UsePAM no | + | # /etc/ |
| - | RSAAuthentication yes | + | |
| - | PermitRootLogin without-password | + | |
| - | PermitEmptyPasswords no | + | |
| - | PasswordAuthentication no | + | |
| - | </code> | + | |
| - | et une autre : | + | #Port non standard: réduit le bruit malveillants |
| - | < | + | MaxAuthTries 3 |
| - | UsePAM no | + | LoginGraceTime 5 |
| - | Subsystem | + | |
| - | IgnoreRhosts yes | + | |
| - | IgnoreUserKnownHosts no | + | |
| - | PrintMotd yes | + | |
| - | StrictModes yes | + | |
| - | RSAAuthentication yes | + | |
| PermitRootLogin no | PermitRootLogin no | ||
| - | PermitEmptyPasswords no | ||
| PasswordAuthentication no | PasswordAuthentication no | ||
| - | </code> | + | PermitEmptyPasswords no |
| - | ==== Maintien de la connexion ==== | + | KbdInteractiveAuthentication no |
| + | # | ||
| + | HostbasedAuthentication no | ||
| + | KerberosAuthentication no | ||
| + | GSSAPIAuthentication no | ||
| + | PubkeyAuthentication yes | ||
| + | AuthorizedKeysFile .ssh/authorized_keys .ssh/ | ||
| + | StrictModes yes | ||
| + | Compression no | ||
| + | AllowTcpForwarding no | ||
| + | X11Forwarding no | ||
| + | AllowAgentForwarding no | ||
| + | AllowStreamLocalForwarding no | ||
| + | IgnoreRhosts yes | ||
| - | < | + | #UsePAM yes ??? |
| - | ServerAliveCountMax | + | # - ^=^s Check which modules are active |
| - | </ | + | |
| - | ''ClientAliveInterval'' | + | HostKeyAlgorithms ssh-ed25519, |
| + | PubkeyAcceptedKeyTypes ssh-ed25519, | ||
| + | MACs hmac-sha2-512-etm@openssh.com, | ||
| + | |||
| + | # remove LC_* to avoid some "Can't set locale; make sure $LC_* and $LANG are correct!" | ||
| + | AcceptEnv LANG | ||
| + | |||
| + | ClientAliveInterval | ||
| + | ClientAliveCountMax | ||
| + | TCPKeepAlive yes | ||
| + | |||
| + | </ | ||
| Ligne 77: | Ligne 101: | ||
| * [[http:// | * [[http:// | ||
| * ssh-agent | * ssh-agent | ||
| + | |||
| + | ==== sshfs ==== | ||
| + | |||
| + | Permet de monter un filesystem distant via ssh | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | < | ||
| + | sshfs -p < | ||
| + | </ | ||
| ===== Tips ===== | ===== Tips ===== | ||
| Ligne 128: | Ligne 162: | ||
| Ssh tunneling (Encrypt your HTTP Traffic and more): | Ssh tunneling (Encrypt your HTTP Traffic and more): | ||
| + | |||
| + | * https:// | ||
| Vous créez un port d' | Vous créez un port d' | ||
informatique/reseau/ssh.1737712294.txt.gz · Dernière modification : de cyrille
