我已经生成了 4096 RSA 证书,并在本地使用 ssh-add 和 github 注册了它。我遵循了官方文档。ssh 工作并且我通过了身份验证,但是我无法将本地存储库推送到 github。原始 URL 是从 github 存储库设置中复制的。
测试 ssh 连接是否正常:
>ssh -T git@github.com
warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512)
Hi leosliterak! You've successfully authenticated, but GitHub does not provide shell access.
但是 git push 不会:
>git push -u origin master
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.
和 git 存储库 URL:
git remote get-url origin
git@github.com:leosliterak/console.git
我真的很困惑,推送被拒绝,而具有相同证书的 ssh 可以。
>ssh-add -L
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAgEAqllZxcxhD0gT650= c:\Users\leos\.ssh\id_rsa