Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
Dernière révisionLes deux révisions suivantes
en:documentation:tutorials:ssh:clef_agent_ssh [2018/05/28 14:20] – [Diffuser la clef publique] cpetiten:documentation:tutorials:ssh:clef_agent_ssh [2020/08/25 15:58] – modification externe 127.0.0.1
Ligne 1: Ligne 1:
-<WRAP center round todo 60%> 
-Translation in progress... 
-</WRAP> 
  
 ====== Use SSK keys and SSH agent ====== ====== Use SSK keys and SSH agent ======
  
-Most oftenly, the SSH client is used with a pair ''[user + password]'' to connect to a remote machine.ne dis­tante. +Most oftenly, the SSH client is used with a pair ''[ user + password ]'' to connect to a remote machine.ne dis­tante. 
  
 However, it is possible to use keys  However, it is possible to use keys 
 (authentication via  private/public key pair, \\ see [[https://en.wikipedia.org/wiki/Public-key_cryptography|here]])  (authentication via  private/public key pair, \\ see [[https://en.wikipedia.org/wiki/Public-key_cryptography|here]]) 
-to connect to a remote server. \\ Moreover, using an SSH agent, you can avoid typing passwords.+to connect to a remote server. \\ Moreover, using an SSH agent, you can avoid typing passwords everytime.
  
-===== Generate a set of key =====+===== Generate a key set =====
  
 To generate your personal key set, use the same commands as the one to generate the [[en:documentation:tutorials:ssh:first_connection|PSMN internal key ]]  .  To generate your personal key set, use the same commands as the one to generate the [[en:documentation:tutorials:ssh:first_connection|PSMN internal key ]]  . 
Ligne 34: Ligne 31:
 </code> </code>
  
 +
 +
 +<WRAP center round info 60%>
 +New default parameters of SSH may generate a ''ed25519'' key type. Replace ''.rsa'' by ''.ed25519'' in next parts of this documentation
 +</WRAP>
 ==== Step 2 : Choose a good/strong passphrase ==== ==== Step 2 : Choose a good/strong passphrase ====
  
Ligne 92: Ligne 94:
 ==== Step 4: Save your ssh key set ==== ==== Step 4: Save your ssh key set ====
  
-You can copy/paste the fingerprint verification (fingerprint + image) into a file '' ~ / .ssh / fingerprint ''.+You can copy/paste the fingerprint verification (fingerprint + image) into a file ''~/.ssh/fingerprint''.
  
 **Save** your private key (''id_rsa''), your fingerprint file (''fingerprint'') and your public key (''id_rsa.pub''), in a safe and personal place (a USB key, for example). **Save** your private key (''id_rsa''), your fingerprint file (''fingerprint'') and your public key (''id_rsa.pub''), in a safe and personal place (a USB key, for example).
Ligne 99: Ligne 101:
 ==== Linux / BSD ==== ==== Linux / BSD ====
  
-Il existe tout un tas de méthodes :+There's a lot of different methods:
  
-  * Utiliser les programmes ''ssh-askpass'' ou ''ssh-askpass-gnome'' de votre distribution favorite... +  * Use ''ssh-askpass''''ssh-askpass-gnome'' or ''ksshaskpass'' from your favorite distribution... 
-  * charger l'agent dans un script :+  * load ssh-agent in a script:
  
 <code bash> <code bash>
Ligne 109: Ligne 111:
 </code> </code>
  
-  * Installer et utiliser [[http://www.funtoo.org/wiki/Keychain|keychain]] (outil CLI, prendre l'archive Release).+  * Install and use [[http://www.funtoo.org/wiki/Keychain|keychain]] (CLI tooluse Release archive). 
 + 
 +You can use a script (in your ''~/.bashrc'') to start keychain, and use it in your session:
  
-Vous pouvez utiliser un script (dans votre ''~/.bashrc'') pour le démarrer, et l'utiliser automatiquement dans vos terminaux : 
 <code bash> <code bash>
 # add key(s) to agent # add key(s) to agent
Ligne 117: Ligne 120:
 </code> </code>
  
 +  * KDE startup script:
 +
 +<code bash>
 +#! /bin/bash
 +# Put this in ~/.kde/Autostart/ssh-agent.sh
 +# or ~/.config/autostart-scripts/ssh-agent.sh
 +export SSH_ASKPASS=/usr/bin/ksshaskpass
 +/usr/bin/ssh-add ~/.ssh/id_rsa  # or any key you want
 +</code>
 ==== MacOS X ==== ==== MacOS X ====
  
-Sur MacOS X, il existe aussi différentes méthodes :+There's also a bunch of methods on MacOS X:
  
-  * Installer et utiliser [[http://www.funtoo.org/wiki/Keychain|keychain]] (outil CLI, prendre le package pour MacOS X).+  * Install and use [[http://www.funtoo.org/wiki/Keychain|keychain]] (CLI tooluse MacOS X package). 
 + 
 +You can use a script (in your ''~/.bashrc'') to start keychain, and use it in Terminal:
  
-Vous pouvez utiliser un script (dans votre ''~/.bashrc'') pour le démarrer, et l'utiliser automatiquement dans Terminal : 
 <code bash> <code bash>
 # add key(s) to agent # add key(s) to agent
Ligne 129: Ligne 142:
 </code> </code>
  
-  * Si vous utilisez MacOSX Keychain, ajoutez l'option ''--inherit any'' :+  * On MacOSX Keychain, you may add the option ''--inherit any'':
 <code bash> <code bash>
 # add key(s) to agent # add key(s) to agent
Ligne 135: Ligne 148:
 </code> </code>
  
-<note important>Sià chaque ouverture de Terminal, keychain demande votre passphrase, enlevez l'option ''--inherit any''</note>+<note important>Ifevery time you open a new Terminal window, keychain ask for your passphrase, remove the ''--inherit any'' option</note>
  
-  * Installer et utiliser [[http://sshkeychain.sourceforge.net/|SSHKeyChain]] (outil graphique)+  * Install and use [[http://sshkeychain.sourceforge.net/|SSHKeyChain]] (GUI tool)
  
  
-<note tip>Pour bénéficier de "l'export X", il faut aussi démarrer le serveur X sur le Macvoir [[documentation:tutorials:ssh:clef_agent_ssh#export_x_pour_macos_x|X11 et MacOS X]]</note>+<note tip>For "exportto workyou need to activate MacOS X11 server (XQuartz)see  
 +[[documentation:tutorials:ssh:clef_agent_ssh#export_x_pour_macos_x|X11 and MacOS X]]</note>
  
  
Ligne 146: Ligne 160:
 ==== Windows ==== ==== Windows ====
  
-Sur Windows, il faut utiliser le logiciel PuTTY, dont l'usage est expliqué [[documentation:tutorials:ssh:putty|sur cette page]].+On Windows, you need to use PuTTY, see [[documentation:tutorials:ssh:putty|this page]]. 
  
 ===== Broadcast the public key ===== ===== Broadcast the public key =====
Ligne 184: Ligne 199:
 (yourlogin correspond to your login at PSMN) (yourlogin correspond to your login at PSMN)
  
-===== Exemples et Cas particuliers =====+===== Examples and use cases =====
  
-==== Exemple de configuration pour Linux et BSD====+==== Linux and BSD configuration example ====
  
-On peut automatiser les étapes de la connexion en utilisant le fichier ''config'' de SSH sur votre poste de travailEn voici un exemple :+You can automate the connection steps by using the SSH config file on your workstationHere is an example:
  
-  * ''~/.ssh/config'' **pour Linux ou BSD**+  * ''~/.ssh/config'' **for Linux or BSD**
  
 <code bash config> <code bash config>
Ligne 205: Ligne 220:
  
 ### ###
-passerelle interne+internal gateway
 Host allo-psmn Host allo-psmn
   User <login PSMN>   User <login PSMN>
   HostName allo-psmn.psmn.ens-lyon.fr   HostName allo-psmn.psmn.ens-lyon.fr
  
-connexion à x5650comp1 depuis l'interieur de l'ENS+connection to x5650comp1 from within ENS network
 Host comp1 Host comp1
   User <login PSMN>   User <login PSMN>
Ligne 216: Ligne 231:
   ProxyCommand ssh <login PSMN>@allo-psmn netcat -w1 %h %p   ProxyCommand ssh <login PSMN>@allo-psmn netcat -w1 %h %p
  
-connexion à e5-2670comp2 depuis l'interieur de l'ENS+connection to e5-2670comp2 from within ENS netwoek
 Host comp2 Host comp2
   User <login PSMN>   User <login PSMN>
Ligne 223: Ligne 238:
  
 ### ###
-passerelle externe+external gateway
 Host allo-externe Host allo-externe
   User <login PSMN>   User <login PSMN>
Ligne 230: Ligne 245:
 #  ProxyCommand ssh <login ENS>@ssh.ens-lyon.fr tcpconnect allo-psmn %p #  ProxyCommand ssh <login ENS>@ssh.ens-lyon.fr tcpconnect allo-psmn %p
  
-connexion à x5650comp1 depuis l'exterieur de l'ENS+connection to x5650comp1 from outside ENS network
 Host comp1-ext Host comp1-ext
   User <login PSMN>   User <login PSMN>
Ligne 236: Ligne 251:
   ProxyCommand ssh <login PSMN>@allo-externe netcat -w1 %h %p   ProxyCommand ssh <login PSMN>@allo-externe netcat -w1 %h %p
  
-connexion à e5-2670comp2 depuis l'exterieur de l'ENS+connection to e5-2670comp2 from outside ENS network
 Host comp2-ext Host comp2-ext
   User <login PSMN>   User <login PSMN>
Ligne 244: Ligne 259:
 </code> </code>
  
-Bien évidemment, il faut remplacer ''<login PSMN>'' par votre login du PSMN, et ''<login ENS>'' par votre login de l'ENS. ''netcat -w1'' peut être remplacé par ''tcpconnect''.+You need to replace ''<login PSMN>'' by your own PSMN loginand ''<login ENS>'' by your ENS login. ''netcat -w1'' can be replaced by ''tcpconnect''.
  
-La liste des serveurs de connexion du PSMN est disponible [[documentation:clusters:services#serveurs_de_compilation|sur cette page]].+The list of connection servers to the PSMN is available  [[documentation:clusters:services#serveurs_de_compilation|here]].
  
-Ce fichier contient déjà des rebondsPour plus d'explicationla documentation sur les rebonds et leur automatisation est disponible [[documentation:tutorials:ssh:multihop_ssh|sur cette page]].+This example file already implement hopsFor more explanationssee the documentation on hops and how to automate them [[en:documentation:tutorials:ssh:multihop_ssh| available here]].
  
-==== Exemple de configuration pour MacOS X ====+==== MacOS X configuration example ====
  
-Sur MacOS X, il vaut mieux utiliser l'option ''-Y'' au lieu de ''-X'' (ou ''ForwardX11Trusted yes'' au lieu de ''ForwardX11 yes'' dans votre fichier ''~/.ssh/config''). En voici un exemple :+On MacOS X, you need to use the ''-Y'' option instead of the ''-X'' (or ''ForwardX11Trusted yes'' instead of ''ForwardX11 yes'' in your ''~/.ssh/config'' file). Here is an example:
  
-  * ''~/.ssh/config'' **pour MacOS X**+  * ''~/.ssh/config'' **for MacOS X**
  
 <code bash config> <code bash config>
Ligne 262: Ligne 277:
   TCPKeepAlive yes   TCPKeepAlive yes
   ForwardAgent yes   ForwardAgent yes
-#  ForwardX11 yes       # pour Linux +#  ForwardX11 yes       # for Linux 
-  ForwardX11Trusted yes # pour MacOSX+  ForwardX11Trusted yes # for MacOSX
   Compression yes   Compression yes
   StrictHostKeyChecking no   StrictHostKeyChecking no
Ligne 269: Ligne 284:
  
 ### ###
-passerelle interne+internal gateway
 Host allo-psmn Host allo-psmn
   User <login PSMN>   User <login PSMN>
   HostName allo-psmn.psmn.ens-lyon.fr   HostName allo-psmn.psmn.ens-lyon.fr
  
-connexion à x5650comp1 depuis l'interieur de l'ENS+connection to x5650comp1 from inside ENS network
 Host comp1 Host comp1
   User <login PSMN>   User <login PSMN>
Ligne 280: Ligne 295:
   ProxyCommand ssh <login PSMN>@allo-psmn netcat -w1 %h %p   ProxyCommand ssh <login PSMN>@allo-psmn netcat -w1 %h %p
  
-connexion à e5-2670comp2 depuis l'interieur de l'ENS+connection to e5-2670comp2 from inside ENS network
 Host comp2 Host comp2
   User <login PSMN>   User <login PSMN>
Ligne 287: Ligne 302:
  
 ### ###
-passerelle externe+external gateway
 Host allo-externe Host allo-externe
   User <login PSMN>   User <login PSMN>
Ligne 293: Ligne 308:
   ProxyCommand ssh <login PSMN>@ssh.psmn.ens-lyon.fr tcpconnect allo-psmn %p   ProxyCommand ssh <login PSMN>@ssh.psmn.ens-lyon.fr tcpconnect allo-psmn %p
  
-connexion à x5650comp1 depuis l'exterieur de l'ENS+connection to x5650comp1 from outside ENS network
 Host comp1-ext Host comp1-ext
   User <login PSMN>   User <login PSMN>
Ligne 299: Ligne 314:
   ProxyCommand ssh <login PSMN>@allo-externe netcat -w1 %h %p   ProxyCommand ssh <login PSMN>@allo-externe netcat -w1 %h %p
  
-connexion à e5-2670comp2 depuis l'exterieur de l'ENS+connection to e5-2670comp2 from outside ENS network
 Host comp2-ext Host comp2-ext
   User <login PSMN>   User <login PSMN>
Ligne 307: Ligne 322:
 </code> </code>
  
-Bien évidemment, il faut remplacer ''<login PSMN>'' par votre login au PSMN. ''netcat -w1'' peut être remplacé par ''tcpconnect''.+You need to replace ''<login PSMN>'' by your own PSMN login, and ''<login ENS>'' by your ENS login. ''netcat -w1'' can be replaced by ''tcpconnect''
 + 
 +The list of connection servers to the PSMN is available  [[documentation:clusters:services#serveurs_de_compilation|here]].
  
-La liste des serveurs de connexion du PSMN est disponible [[documentation:clusters:services#serveurs_de_compilation|sur cette page]]+This example file already implement hops. For more explanations, see the documentation on hops and how to automate them [[en:documentation:tutorials:ssh:multihop_sshavailable here]].
  
-Ce fichier contient déjà des rebonds. Pour plus d'explication, la documentation sur les rebonds et leur automatisation est disponible [[documentation:tutorials:ssh:multihop_ssh|sur cette page]]. 
  
-==== export X pour MacOS X ====+==== export X for MacOS X ====
  
-Pour pouvoir utiliser "l'export X" sur un Mac, il faut démarrer le logiciel X11 (dans Applications/Utilitaires, comme Terminal) avant d'initier une connexion SSH. 
  
-==== Rebonds et multiples rebonds ====+To be able to use "export X" on a Mac, you have to start the X11 software (in Applications/Utilities, like Terminal) before initiating an SSH connection. 
 +==== Hops and multihops ====
  
-Pour plus d'explicationla documentation sur les rebonds et leur automatisation est disponible [[documentation:tutorials:ssh:multihop_ssh|sur cette page]].+For more explanation on hops and their automation, [[en:documentation:tutorials:ssh:multihop_ssh|see this page]].