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édenteProchaine révisionLes deux révisions suivantes | ||
informatique:reseau:ssh [17/05/2010 21:03] – cyrille | informatique:reseau:ssh [30/06/2022 09:01] – [Tunnel] 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 ===== | ||
- | ==== Clients pour Windows | + | ==== ClusterSSH |
- | http://www.openssh.com/windows.html \\ | + | http://sourceforge.net/apps/mediawiki/clusterssh/ |
- | http://www.funix.org/fr/ | + | |
- | SSH Tectia Client (previously SSH Secure Shell for Workstations) :\\ | + | ClusterSSH is a tool for making the same change on multiple servers at the same time. The ' |
- | http://www.ssh.com/ | + | |
+ | This tool is intended for (but not limited to) cluster administration where the same configuration or commands must be run on each node within the cluster. Performing these commands all at once via this tool ensures all nodes are kept in sync. | ||
+ | |||
+ | |||
+ | ==== Clients pour Windows ==== | ||
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 ==== | ||
+ | |||
+ | * Keychain | ||
+ | http:// | ||
+ | * [[http:// | ||
+ | * ssh-agent | ||
===== Tips ===== | ===== Tips ===== | ||
Ligne 55: | Ligne 88: | ||
# 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 67: | Ligne 110: | ||
==== 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 78: | Ligne 123: | ||
RSSH: http:// | RSSH: http:// | ||
+ | |||
+ | ==== via Proxy ==== | ||
+ | |||
+ | <code bash> | ||
+ | scp -o ' | ||
+ | </ | ||
+ | |||
+ | ==== Tunnel ==== | ||
+ | |||
+ | Ssh tunneling (Encrypt your HTTP Traffic and more): | ||
+ | |||
+ | Vous créez un port d' | ||
+ | ssh -D port-local nomutilisateur@nomhôte | ||
+ | |||
+ | === Forwarding === | ||
+ | |||
+ | ssh -C -NL 9999: | ||
+ | |||
+ | * -C parameter to compress data (optional - useful for low bandwidth connections) | ||
+ | * -N parameter to not execute a remote command (i.e. no prompt on the remote machine) | ||
+ | * -L parameter for port forwarding from port 9999 on localhost to port 5900 on REMOTE_HOST. | ||
+ | |||
+ | Ne fonctionne pas toujours avec ' | ||
+ | ssh -N -L 127.0.0.1: | ||
+ | |||
+ | Se connecter à un serveur via un autre serveur (forwarding agent): | ||
+ | |||
+ | ssh -p <public port> -t -A root@< | ||
+ | |||
+ | Via la configuration du client SSH, ce qui du coup fonctionne avec SCP: | ||
+ | |||
+ | # | ||
+ | Host machineC | ||
+ | ProxyCommand ssh -p XXX user@machineB nc %h %p | ||
+ | |||
+ | Ouvrir une console via une autre machine: | ||
+ | |||
+ | ssh -t -A toto@s1.artefacts.coop ssh -t toto@s2.artefacts.coop | ||
+ | |||
informatique/reseau/ssh.txt · Dernière modification : 19/02/2024 10:42 de cyrille