github 的22端口无法连接的解决办法

$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out

 

可以看到22端口无法连接

 

解决办法:

改为443端口。

在ssh key所在文件夹下添加一个文件,文件名是config

内容:

Host github.com
User  yourmail@xx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

之后再设置下

git config --global user.name "XXX"
git config --global user.email XXX@xx.com

目的是刷新config。
问题解决,可以push和pull等操作了。
 
posted @ 2020-03-17 10:53  向萧  阅读(1837)  评论(0编辑  收藏  举报