Git and ssh authorizating

前端 未结 9 1798
有刺的猬
有刺的猬 2021-02-02 02:13

I can\'t login to github with generated ssh-keys. I\'ve followed this manual: http://help.github.com/linux-key-setup but at step:

ssh git@github.com

<
相关标签:
9条回答
  • 2021-02-02 03:06

    This issue occurs mainly due to the following reasons :

    • The public and private key pair is wrong. You have to verify the key public key on the server/ your git account where you have placed the public key. Even a small space or tab will result in the error.
    • If you are sure your public key is correct, then check the format of public key in your ~/.ssh folder in your machine. For openssh you cannot use a public key in puttygen format and visa-versa. To change the format you can use the following command using your private key

      $ ssh-keygen -e -f ~/.ssh/id_rsa > ~/.ssh/id_rsa_com.pub
      $ ssh-keygen -i -f ~/.ssh/id_rsa_com.pub > ~/.ssh/id_rsa.pub

    • Finally check if you have added your keys to the ssh client in your system. You can do so by using the following commands

      $ eval "$(ssh-agent -s)"

      $ ssh-add

    0 讨论(0)
  • 2021-02-02 03:09

    This is a ubuntu problem. Exporting "SSH_AUTH_SOCK=0" solved the problem for me. More details can be found at - https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/201786.

    0 讨论(0)
  • 2021-02-02 03:14

    After generating the ssh keys I executed the command listed below as suggested by jamesw.

    $ ssh-add ~/.ssh/id_rsa
    

    I entered my password. Then retried to clone the heroku repository. This time it worked fine.

    0 讨论(0)
提交回复
热议问题