在添加完公鑰之后, 遇到了下面這種問題:
[root@wdOS dtc2]# git clone git@github.com:xxxxx/dtc2
Cloning into 'Show'...
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
說是主機密鑰驗證失敗, 可以查看.ssh目錄是否缺少了 known_hosts 文件, 而且必須生成 github.com 的ip執(zhí)行內(nèi)容. 如下:
[root@iZ94xpmg9boZ .ssh]# ssh git@github.com
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
Permission denied (publickey).
然后 .ssh 目錄里將是三個文件 . 這樣就OK了俗批。