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 [16/08/2017 10:10] – [Clients pour Windows] cyrille | informatique:reseau:ssh [16/10/2025 14:29] (Version actuelle) – [Linux Keychain Guide] cyrille | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Secure SHell ====== | + | ====== Secure SHell (SSH) ====== |
| ===== Configuration ===== | ===== Configuration ===== | ||
| - | Dans / | + | Dans / |
| - | PermitRootLogin Yes | + | |
| - | en | + | < |
| - | PermitRootLogin No | + | PermitRootLogin Yes |
| + | en | ||
| + | PermitRootLogin No | ||
| + | </ | ||
| Et si tu veux autoriser l' | Et si tu veux autoriser l' | ||
| - | | + | |
| - | Mais bon ça marche pas ... | + | < |
| + | PermitRootLogin without-password | ||
| + | </ | ||
| + | |||
| + | Mais bon ça marche pas … | ||
| Voici une config qui fontionne : | Voici une config qui fontionne : | ||
| - | | + | |
| - | RSAAuthentication yes | + | < |
| - | PermitRootLogin without-password | + | UsePAM no |
| - | PermitEmptyPasswords no | + | RSAAuthentication yes |
| - | PasswordAuthentication no | + | PermitRootLogin without-password |
| + | PermitEmptyPasswords no | ||
| + | PasswordAuthentication no | ||
| + | </ | ||
| et une autre : | et une autre : | ||
| - | | + | |
| - | Subsystem sftp / | + | < |
| - | IgnoreRhosts yes | + | UsePAM no |
| - | IgnoreUserKnownHosts no | + | Subsystem |
| - | PrintMotd yes | + | IgnoreRhosts yes |
| - | StrictModes yes | + | IgnoreUserKnownHosts no |
| - | RSAAuthentication yes | + | PrintMotd yes |
| - | PermitRootLogin no | + | StrictModes yes |
| - | PermitEmptyPasswords no | + | RSAAuthentication yes |
| - | PasswordAuthentication no | + | PermitRootLogin no |
| + | PermitEmptyPasswords no | ||
| + | PasswordAuthentication no | ||
| + | </ | ||
| + | ==== Maintien de la connexion ==== | ||
| + | |||
| + | < | ||
| + | ServerAliveCountMax | ||
| + | </ | ||
| + | |||
| + | '' | ||
| ===== Clients ===== | ===== Clients ===== | ||
| Ligne 54: | Ligne 77: | ||
| * [[http:// | * [[http:// | ||
| * ssh-agent | * ssh-agent | ||
| + | |||
| + | ==== sshfs ==== | ||
| + | |||
| + | Permet de monter un filesystem distant via ssh | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | < | ||
| + | sshfs -p < | ||
| + | </ | ||
| ===== Tips ===== | ===== Tips ===== | ||
| Ligne 65: | Ligne 98: | ||
| # ATTENTION : local5 est utilisé notamment par sshd | # ATTENTION : local5 est utilisé notamment par sshd | ||
| local5.info / | local5.info / | ||
| + | |||
| + | Le port 22 est scanné en permanence, ce qui rempli le disque (risque [[glossaire/ | ||
| + | <code bash> | ||
| + | root@seriously: | ||
| + | total 13M | ||
| + | -rw-rw---- | ||
| + | -rw-r----- | ||
| + | -rw-r----- | ||
| + | -rw------- | ||
| + | </ | ||
| ==== Email automatique lors de la connexion ==== | ==== Email automatique lors de la connexion ==== | ||
| Ligne 77: | Ligne 120: | ||
| ==== Blacklister les Ips indésirables ==== | ==== Blacklister les Ips indésirables ==== | ||
| - | Avec le script ssh-blacklist, voir [[informatique/ | + | SSH scanning ssh-blacklist |
| + | |||
| + | Blacklister les Ips indésirables avec le script | ||
| ==== Chroot Jail ==== | ==== Chroot Jail ==== | ||
| Ligne 88: | Ligne 133: | ||
| RSSH: http:// | RSSH: http:// | ||
| + | |||
| ==== Tunnel ==== | ==== Tunnel ==== | ||
| Ligne 106: | Ligne 152: | ||
| Ne fonctionne pas toujours avec ' | Ne fonctionne pas toujours avec ' | ||
| ssh -N -L 127.0.0.1: | ssh -N -L 127.0.0.1: | ||
| + | |||
| + | |||
| + | === Proxying === | ||
| + | |||
| + | <code bash> | ||
| + | scp -o ' | ||
| + | </ | ||
| Se connecter à un serveur via un autre serveur (forwarding agent): | Se connecter à un serveur via un autre serveur (forwarding agent): | ||
| ssh -p <public port> -t -A root@< | ssh -p <public port> -t -A root@< | ||
| + | |||
| + | proxying (JumpHost): | ||
| + | |||
| + | ssh -J jump-user@jump.net: | ||
| Via la configuration du client SSH, ce qui du coup fonctionne avec SCP: | Via la configuration du client SSH, ce qui du coup fonctionne avec SCP: | ||
| - | | + | < |
| Host machineC | Host machineC | ||
| ProxyCommand ssh -p XXX user@machineB nc %h %p | ProxyCommand ssh -p XXX user@machineB nc %h %p | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | host un-nom-raccourci | ||
| + | Hostname destination.finale.net | ||
| + | ProxyCommand ssh -p 666 -W %h:22 user-passerelle@passerelle.ssh.net | ||
| + | User user-destination | ||
| + | IdentityFile $SSHKEY | ||
| + | </ | ||
| Ouvrir une console via une autre machine: | Ouvrir une console via une autre machine: | ||
informatique/reseau/ssh.1502871042.txt.gz · Dernière modification : de cyrille
