• [^] # Re: Choix de la clé

    Posté par . En réponse au message Authentification ssh avec deux comptes gitlab.com et deux pairs de clés. Évalué à 1.

    Merci Cyril
    Mais j'ai déjà essayé cette config que j'ai trouvé sur stackoverflow et elle ne fonctionne pas sur ma machine.

     system@notebook:~$ cat ~/.ssh/config 
     Host gitlab-pro
     Hostname gitlab.com
     #Preferredauthentications publickey
     IdentityFile ~/.ssh/keygitlabpro
    
     Host gitlab-perso
     Hostname gitlab.com
     #Preferredauthentications publickey
     IdentityFile ~/.ssh/keygitlabperso
    

    Voici ce que ça donne sur mon poste.

     system@notebook:~/gitroot/lab/test/test$ git clone 
     git@gitlab.com:gitlabperso/cloud.git
     Cloning into 'cloud'...
     The project you were looking for could not be found.
     fatal: Could not read from remote repository.
     Please make sure you have the correct access rights and the repository exists.
     system@notebook:~/gitroot/lab/test/test$ 
    

    Alors que la même paire de clé déposée sur un autre poste me permet de faire le git clone sans problème et même avec le commande ssh comme ceci.

    $ ssh -i ~/.ssh/keygitlabperso git@gitlab.com
    PTY allocation request failed on channel 0
    Welcome to GitLab, @yourgitlabperso!
    Connection to gitlab.com closed.
    

    Je veux bien essayer autre chose si tu as une idée.

    Merci