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 [15/01/2017 01:45] – [Forwarding] Ouvrir une console via une autre machine 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 41: | Ligne 64: | ||
| ==== Clients pour Windows ==== | ==== Clients pour Windows ==== | ||
| - | |||
| - | http:// | ||
| - | http:// | ||
| - | |||
| - | SSH Tectia Client (previously SSH Secure Shell for Workstations) :\\ | ||
| - | http:// | ||
| Tunnelier : http:// | Tunnelier : http:// | ||
| - | PuTTY : http:// | + | PuTTY : [[http:// |
| - | SharpSSH - A Secure Shell (SSH) library for .NET: http:// | + | SharpSSH - A Secure Shell (SSH) library for .NET: http:// |
| ==== Linux Keychain Guide ==== | ==== Linux Keychain Guide ==== | ||
| Ligne 60: | Ligne 77: | ||
| * [[http:// | * [[http:// | ||
| * ssh-agent | * ssh-agent | ||
| + | |||
| + | ==== sshfs ==== | ||
| + | |||
| + | Permet de monter un filesystem distant via ssh | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | < | ||
| + | sshfs -p < | ||
| + | </ | ||
| ===== Tips ===== | ===== Tips ===== | ||
| Ligne 71: | 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 83: | 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 94: | Ligne 133: | ||
| RSSH: http:// | RSSH: http:// | ||
| + | |||
| ==== Tunnel ==== | ==== Tunnel ==== | ||
| Ligne 112: | 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.1484441111.txt.gz · Dernière modification : de cyrille
