git操作常见错误处理
1.Error:The authenticity of host 'github.com (192.30.255.112)' can't be established.
Git密钥认证github时出现如下错误:
$ ssh -T git@github.com
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKY8.
Are you sure you want to continue connecting (yes/no)?1234
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKY8.
Are you sure you want to continue connecting (yes/no)?1234
解决方法:
直接输入 yes 回车,这时在ssh目录下除id_rsa,id_rsa.pub文件外,还会生成一个know_hosts 文件。
直接输入 yes 回车,这时在ssh目录下除id_rsa,id_rsa.pub文件外,还会生成一个know_hosts 文件。
$ ssh git@github.com
PTY allocation request failed on channel 0
You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
PTY allocation request failed on channel 0
You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
2.git连接拒绝
ssh -T git@github.com
[root@control-compute00 nova]# ssh-add
Could not open a connection to your authentication agent.
[root@control-compute00 nova]# ssh-agent bash
[root@control-compute00 nova]# ssh-add -l
The agent has no identities.
[root@control-compute00 nova]# ssh-add ~/.ssh/id_rsa
Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)
ssh -T git@github.com
[root@control-compute00 nova]# ssh-add
Could not open a connection to your authentication agent.
[root@control-compute00 nova]# ssh-agent bash
[root@control-compute00 nova]# ssh-add -l
The agent has no identities.
[root@control-compute00 nova]# ssh-add ~/.ssh/id_rsa
Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)