Windows10 下 github ssh 访问出现 Permission denied(publickey)错误的解决方法

Windows10 下 github ssh 访问出现 Permission denied(publickey)错误的解决方法。

  • 错误信息:

    git clone git@github.com:ediwang/envsetup.git
    Cloning into 'envsetup'...
    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    
  • 解决方法:

    • 打开 services.msc , 找到 OpenSSH Authentication Agent 服 务,然后启用它。

    • 进入 .ssh 目录

    • 执行 ssh-agent -s

    • 执行 ssh-add id_rsa (id_rsa 要换成自己的)

    • 执行 ssh -T git@github.com,如果出现:
      Hi molisiye! You've successfully authenticated, but GitHub does not provide shell access. 就说明可以通过 ssh 访问 github 了

posted @ 2019-04-30 15:17  molisiye  阅读(2584)  评论(0编辑  收藏  举报