- 原因可能是端口被占用
- 在 ~/.ssh目錄下創(chuàng)建個(gè)文件名為config的文件
$ touch config
- 填寫如下內(nèi)容并保存
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
- 測(cè)試
$ ssh -T git@github.com
The authenticity of host '[ssh.github.com]:443 ([192.30.252.1]:443)' can't be established.
RSA key fingerprint is SHA256:nThARLviKw6E5SYbg6kXUpJWGl7E1IGOCspRomTxdC8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.github.com]:443,[192.30.252.1]:443' (RSA) to the list of known hosts.
Hi [your name]! You've successfully authenticated, but GitHub does not provide shell access.
# 雖然有個(gè)警告黔夭,這個(gè)GitHub上有人說這個(gè)只要IP是在192.30.252.0到192.30.255.255之間的話是沒關(guān)系的扫倡。