Git and ssh authorizating

前端 未结 9 1825
有刺的猬
有刺的猬 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

提交回复
热议问题