新申请的git repo,也通过ssh-keygen生成了id_rsa.pub文件并上传到settings,但是还是要求输入用户名,密码。
原因是git config配置的remote url是https模式,而不是ssh模式。所以尽管上传了公钥,也不起作用。
在客户端输入:
[root@Server-i-teyxo1lcse chaosblade-operator]# git remote -v
origin https://github.com/chaosblade/chaosblade-operator.git (fetch)
origin https://github.com/chaosblade/chaosblade-operator.git (push)
#接下来改为:
root@Server-i-teyxo1lcse chaosblade-operator]# git remote rm origin
[root@Server-i-teyxo1lcse chaosblade-operator]# git remote -v
[root@Server-i-teyxo1lcse chaosblade-operator]# git remote add origin git@github.com:chaosblade/chaosblade-operator.git
···
接下来再push就不用输入用户名和密码了