From Mageia wiki
Jump to: navigation, search
(Introduction: -trad)
(Créer une clef SSH: -trad)
Line 10: Line 10:
 
= Créer une clef SSH =
 
= Créer une clef SSH =
  
First of all you will need to create an RSA SSH authentication key:  
+
Avant tout, vous devez créer une clef d’authenticité RSA pour SSH :
  
Install the ''openssh'' package if it is not already installed.
+
Si ce n'est pas déjà installé, installez le paquet ''openssh''.
  
Run the ''ssh-keygen'' command. Executing ''ssh-keygen'' will generate two files (by default):
+
Lancez la commande ''ssh-keygen''. Par défaut, cette commande génère deux fichiers :
 +
* ''~/.ssh/id_rsa'', qui contient l'identité authentifiée par le protocole RSA de l'utilisateur,
 +
* ''~/.ssh/id_rsa.pub'', qui contient la clef '''public''' du protocole RSA pour l'identification distant.
  
* ''~/.ssh/id_rsa'', which contains the protocol version 2 RSA authentication identity of the user
+
Lorsque vous générerez une clef SSH, il vous sera demandé si vous souhaitez utiliser un mot de passe, c'est vraiment recommandé. Gardez à l'esprit qu'il n'y a aucun moyen de récupérer ce mot de passe si vous le perdez alors soyez sûr d'en choisir un fort et facile pour vous de vous en souvenir.
* ''~/.ssh/id_rsa.pub'', which contains the protocol version 2 RSA '''public''' key for authentication.
 
  
When generating an ssh key you will be asked if you want to use a passphrase, this is very much recommended. Be aware that there is no way to recover a lost passphrase, so make sure to select one that is both strong and easily remembered by you.
+
Le fichier ''./.ssh.id_rsa'' ne doit être lisible par aucun autre utilisateur que vous, si cette condition n'est pas satisfaite, il sera ignoré par le logiciel ssh-agent et vous ne pourrez pas vous connecter à distance ni à SVN ni au système de construction des paquets.  
  
The ''~/.ssh/id_rsa'' file must not be readable for other users, as it will be ignored by ssh-agent if this condition isn't satisfied.
+
Pour plus d'information, référez vous à la page man de ssh-keygen.
 
 
For more information check the man page of ssh-keygen.
 
  
 
= Charger votre clef SSH sur le serveur =
 
= Charger votre clef SSH sur le serveur =

Revision as of 14:57, 12 July 2018

Template:Bandeau multi-langues-fr

Accueil [en] Accueil Équipes Packageurs Les outils d'empaquetage Mageia Empaqueteur ssh


Warning!
Cette page est en cours de traduction. N'hésitez pas continuer la traduction, à la relire ou la corriger !

Introduction

Après avoir rejoint un groupe de mainteneur sur Mageia, vous allez vraisemblablement avoir besoin de droit d'écriture pour soumettre vos paquets et les sources à SVN et au système de construction des paquets (au début vous ne pourrez pas soumettre vos paquets avant la fin de votre période de formation ainsi que l’approbation de votre tuteur à vous donner les droits complet de mainteneur). Les changements peuvent être opéré en utilisant le protocole internet SSH (en). Cet article devrait vous aider avec le paramétrage de base pour SSH.

Créer une clef SSH

Avant tout, vous devez créer une clef d’authenticité RSA pour SSH :

Si ce n'est pas déjà installé, installez le paquet openssh.

Lancez la commande ssh-keygen. Par défaut, cette commande génère deux fichiers :

  • ~/.ssh/id_rsa, qui contient l'identité authentifiée par le protocole RSA de l'utilisateur,
  • ~/.ssh/id_rsa.pub, qui contient la clef public du protocole RSA pour l'identification distant.

Lorsque vous générerez une clef SSH, il vous sera demandé si vous souhaitez utiliser un mot de passe, c'est vraiment recommandé. Gardez à l'esprit qu'il n'y a aucun moyen de récupérer ce mot de passe si vous le perdez alors soyez sûr d'en choisir un fort et facile pour vous de vous en souvenir.

Le fichier ./.ssh.id_rsa ne doit être lisible par aucun autre utilisateur que vous, si cette condition n'est pas satisfaite, il sera ignoré par le logiciel ssh-agent et vous ne pourrez pas vous connecter à distance ni à SVN ni au système de construction des paquets.

Pour plus d'information, référez vous à la page man de ssh-keygen.

Charger votre clef SSH sur le serveur

Please ensure your account has apprentice level.

You need to upload your public SSH key to the mageia server before you are allowed to connect to the SVN. This is done through https://identity.mageia.org/.

To do that, when connected with your account on https://identity.mageia.org/, add the attribute sshPublicKey with the content of your public key (content of the file ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub).

Once your SSH key has been added, it can take up to ten minutes for the key to be active on the server.

To check that your ssh key has been correctly uploaded, try to connect with ssh to svn.mageia.org

 $ ssh login@svn.mageia.org :

where login is your login.

If your ssh key is accepted, you should have the following message (possibly after typing your ssh key pass phrase) :

 Sorry, you are not allowed to execute that command

This means that your ssh key was correctly uploaded to the server. If not, SSH will request a password instead of displaying this message.

Note that if you don't have a passphrase, a password will be requested, even if the ssh key was correctly loaded. In this case, you can use the test below to see if you have access.

Agent SSH

If your SSH key is protected with a pass phrase, you will need to type this pass phrase each time the key is used. This will quickly become annoying as the key is used more than once for each commit or svn operation. To avoid this, it is recommended to use an ssh agent. It is a programme to hold private keys used for public key authentication. It should be started at login, see below.

Pour GNOME

In GNOME ssh keys are handled by gnome-keyring, which is installed by default and and running by default when GNOME is up.

Pour KDE4

The easiest way is to follow these steps:

  • install the keychain package
  • excute this command in a terminal keychain: this will create the ~/.keychain directory in your own home directory and start an ssh-agent process
  • Open a terminal emulator (e.g. konsole): you will be asked for your ssh key passphrase. You will only need to enter the passphrase once, because after the first time your ssh key will be added to the running ssh-agent. This will survive a log out -> log in, but not a reboot.

Note that, if you have multiple SSH keys on your computer, keychain only loads $HOME/.ssh/id_rsa. If you need to load multiple keys, you can define the environment variable KEYCHAIN_KEYS in HOME/.keychain/config listing your keys, separated by a space. For instance :

KEYCHAIN_KEYS="$HOME/.ssh/id_ed25519 $HOME/.ssh/id_rsa"

The keys will be loaded in order.

methode basique

If you do not want to use any of the tools above, you can use ssh-agent:

  • First to start an ssh-agent process at login, you can add one of the following lines:
eval $(ssh-agent)
ssh-agent /bin/bash

to ~/.xinitrc.

  • Next you will need to add your ssh key to the running ssh-agent by executing ssh-add ~/.ssh/id_rsa

Éditer ~/.ssh/config et le transfert d'agent SSH

To complete the process, you need to edit ~/.ssh/config on your local machine with any text editor (create it if it doesn't exist, but it should be there: see above) and add the following lines to it:

Host *.mageia.org 
      ForwardAgent yes
      User username

then save the file.

username is the exact user name you created in Mageia Identity (see above). Note that this is mandatory only if the user name on your local machine is different than the one in SVN, if it is the same you do not strictly need to add the User line.

ForwardAgent yes will enable SSH agent forwarding, from the ssh_config man page:

«Il ne faut activé le transfert d'agent qu'avec précaution. En effet, les utilisateurs capables de contourner les permissions des fichiers sur la machines distante (pour obtenir la socket unix-domain de l'agent) peuvent accéder à l'agent local via le transfert de connexion. Un attaquant ne peut pas obtenir d'information sur les clefs à partir de l'agent, en revanche il peut effectuer des opérations sur les clefs lui permettant de s'authentifier avec l'identité chargée dans l'agent.»


That's it: now you can checkout packages from the Mageia SVN repo using mgarepo (the Mageia tool for checking out and submitting packages). Note that you can't submit packages until your mentor clears your account to be a full maintainer's account.

Test de vérification

Try the following command to check that you can access the svn repository through ssh :

 $ svn ls svn+ssh://svn.mageia.org/svn/packages

The output should be the list of directories at the root of the packages svn repository.