公鑰已經加到git上,可是本地依然報錯:
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解決:1:執行 ssh -T git@github.com, 依然報錯。
2: 執行 cd ~/.ssh, 建一個文件config, 文件內容如下:
Host github.com User XXXXXXX@XXX.com Hostname ssh.github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa Port 443
3: 再執行ssh -T git@github.com 就可以了