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 了