SSH 到 Git 时 Connection timed out

问题出现

git仓库是使用ssh链接clone下来的,在pushpull到github时突然失效了,显示Connection timed outssh -T git@github.com一样不行

解决方案

编辑文件~/.ssh/config,添加以下内容

Host github.com
HostName ssh.github.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

再操作就可以了。

posted on 2024-02-14 18:58  未连接到互联网  阅读(72)  评论(0编辑  收藏  举报