- 原因可能是端口被占用
- 在 ~/.ssh目录下创建个文件名为config的文件
$ touch config
- 填写如下内容并保存
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
- 测试
$ 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.
# 虽然有个警告,这个GitHub上有人说这个只要IP是在192.30.252.0到192.30.255.255之间的话是没关系的。
网友评论