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:first_connection [2017/12/21 08:54] – [Generate SSH keys] cpetiten:documentation:tutorials:ssh:first_connection [2020/08/25 15:58] – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 ====== First SSH connection ====== ====== First SSH connection ======
  
-<WRAP center round todo 60%> +===== From ENS network =====
-under construction +
-</WRAP>+
  
  
-At your <wrap em>first attempt to connect to ''allo-psmn''</wrap> (either from the ENS network or from outside), you need to <wrap em>strictly follow these instructions </wrap> !+  * To connect to ''allo-psmn'' from the ENS network, simply type in a terminal the following command: 
 + 
 +<code bash > 
 +ssh <mylogin>@allo-psmn.psmn.ens-lyon.fr 
 +</code> 
 + 
 +===== From outside of ENS network ===== 
 + 
 +   * To connect to ''allo-psmn'' from outside of the ENS network, you first need to connect to ''ssh.psmn.ens-lyon.fr'' in order to access the ENS network. Then connect to  ''allo-psmn''. In a terminal, type the following commands:  
 + 
 +<code bash> 
 +ssh <mylogin>@ssh.psmn.ens-lyon.fr 
 +# enter your PSMN password 
 +# then  
 +ssh <mylogin>@allo-psmn.psmn.ens-lyon.fr 
 +# enter your PSMN password 
 +</code> 
 + 
 +===== First connection error message ===== 
 + 
 +<WRAP center round important 82%> 
 +At your <wrap em>first attempt to connect to ''allo-psmn''</wrap> (either from the ENS network or from outside),  
 +you need to <wrap em>strictly follow these instructions </wrap> ! 
 +</WRAP> 
  
  
Ligne 23: Ligne 45:
 ===== Generate SSH keys ===== ===== Generate SSH keys =====
  
 +<note important>**WARNING**: This step provide a key pair without passphrase, for job submission. This key pair **MUST NOT** leave PSMN. It is equivalent to a master key on your home.</note>
  
-Si vous ne disposez pas déjà d'un jeu de clefs SSH sans mot de passevous allez le créer la première fois que vous vous connectez (pour simplifier le fonctionnement du système de calculsvous devez disposer d'un jeu de clefs SSH sans mot de passe). Tapez les lignes de commande suivantes :+If you don't have already a SSH key pair **without** passphraseyou need to create it first time you connect (In order to simplify the computation systemyou **must** have a PSMN'SSH key pair **without** passphrase). Strictly follow these CLI instructions:
  
-<code bash>ssh-keygen -t dsa</code>+<code bash> 
 +ssh-keygen -t rsa 
 +</code>
  
-• To the question: 
  
-<code bash>Generating public/private dsa key pair. +• To the question: 
-Enter file in which to save the key (/home/votrelogin/.ssh/id_dsa) :+<code bash> 
 +Generating public/private rsa key pair. 
 +Enter file in which to save the key (/home/votrelogin/.ssh/id_rsa) :
 </code> </code>
  
-<wrap hi>Hit ''Enter''</wrap>+<wrap hi>Hit ENTER</wrap> (default answer)
  
-répondez par la touche Enter (réponse par défaut). +• to the questions:
- +
-• Aux questions :+
  
 <code bash> <code bash>
Ligne 50: Ligne 74:
 </code> </code>
  
-répondez par la touche Enter (réponse par défaut).+<wrap hi>Hit ENTER</wrap> (default answer)
  
-<code bash>ssh-keygen -t rsa</code>+===== Keys copy =====
  
-• To the question:+Then, create the  ''~/.ssh/authorized_keys'' file by  typing:
  
 <code bash> <code bash>
-Generating public/private rsa key pair. +touch ~/.ssh/authorized_keys
-Enter file in which to save the key (/home/votrelogin/.ssh/id_rsa) :+
 </code> </code>
  
-répondez par la touche Enter (réponse par défaut)+Next, add your public SSH key (''id_rsa.pub'') to the ''~/.ssh/authorized_keys'' file:
- +
-• to the questions: +
- +
-<code bash>Enter passphrase (empty for no passphrase) :</code> +
- +
-and +
  
 <code bash> <code bash>
-Enter same passphrase again :+cat .ssh/id_rsa.pub >> ~/.ssh/authorized_keys
 </code> </code>
  
-répondez par la touche Enter (réponse par défaut) 
  
-===== Copie des clefs =====+If you already have a pair of SSH authentication keys without password, **copy** the public key (id_rsa.pub) in ''~/.ssh/authorized_keys''.
  
  
-Ensuitepour créer le fichier ''~/.ssh/authorized_keys'' tapez+Besidesif you also have a personal pair of SSH authentication keys (with passphrase), you can **add** your personal SSH public key (''id_rsa.pu''b) to the ''~/.ssh/authorized_keys'' file.
  
-<code bash>touch ~/.ssh/authorized_keys</code>+===== Minimal configuration =====
  
-puis, ajoutez les clefs publiques (id_?sa.pub) au fichier ''~/.ssh/authorized_keys'' : 
  
-<code bash>cat .ssh/id*.pub >> ~/.ssh/authorized_keys</code>+To automate as much as possible connections to machines and compute nodes, create the following configuration file (''~/.ssh/config'') :
  
-Si vous disposez déjà d'un jeu de clef SSH sans mot de passe, copiez les clefs publiques (id_?sa.pub) dans le fichier ''~/.ssh/authorized_keys''+<code bash ~/.ssh/config>
- +
-Si vous disposez aussi d'un jeu de clefs SSH personnel (avec passphrase), vous pouvez ajouter votre clef publique (id_?sa.pub) au fichier ''~/.ssh/authorized_keys''+
- +
-===== Configuration minimum ===== +
- +
-Pour automatiser le plus possible les connexions aux machines et noeuds de calcul, créez le fichier de configuration suivant (''~/.ssh/config'') : +
- +
-<code bash config>+
 Host * Host *
   ServerAliveInterval 60   ServerAliveInterval 60
   ForwardX11Timeout 1d   ForwardX11Timeout 1d
 +  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
 +  HashKnownHosts no
 </code> </code>
  
-Vous trouverez **un fichier plus complet** sur la page [[documentation:tutorials:ssh:clef_agent_ssh&#exemple_de_configuration_pour_linux_et_bsd|Exemple de configuration SSH]], et la liste des serveurs de connexion du PSMN est disponible [[documentation:clusters:services#serveurs_de_compilation|sur cette page]]. 
  
 +You can find ** a more complete file ** on the page [[documentation:tutorials:ssh:clef_agent_ssh&#exemple_de_configuration_pour_linux_et_bsd|Example of SSH configuration]].
  
-----+Moreover, the list of front machine (connection servers) is available at [[documentation:clusters:services#serveurs_de_compilation|the following page]].
  
-Retour à [[documentation:tutorials:ssh:accueil|Se connecter aux clusters avec SSH]]+ 
 +---- 
 +Back to  [[en:documentation:tutorials:ssh:accueil|SSH connection to front machines]]