2

GitHub SSH key 没生效的问题

 2 years ago
source link: https://wayou.github.io/2021/08/20/GitHub_SSH_key_%E6%B2%A1%E7%94%9F%E6%95%88%E7%9A%84%E9%97%AE%E9%A2%98/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

GitHub SSH key 没生效的问题

2021 8 月 20 日

GitHub SSH key 没生效的问题

通过官方文档进行 SSH key 的配置,完了发现提交代码时还弹出用户名密码输入的提示,那必然是 SSH key 没生效。

通过如下命令看了下输出:

$ ssh -T [email protected]
Hi wayou! You've successfully authenticated, but GitHub does not provide shell access.

于是就有眉目了,Google 了下对应原因,通过这个 StackOverflow 的回答找到了答案,原因是仓库通过 http clone,而 ssh key 需要使用 git 方式 clone。

修正方式是将仓库的远端地址切换到 git 即可:

$ git remote set-url origin [email protected]:foo/bar.git

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK