突然git clone报错了,之前没遇到过,记录一下
报错信息:
ssh: connect to host github.com port 22: Connection timed out
Please make sure you have the correct access rights
and the repository exists.
运行以下命令检查ssh是否能够连接成功
ssh -T git@github.com
报错:
$ ssh -vT git@github.com
OpenSSH_9.2p1, OpenSSL 1.1.1t 7 Feb 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [20.205.243.166] port 22.
debug1: connect to address 20.205.243.166 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out
这个错误消息表明计算机无法通过 SSH 连接到 GitHub。 "Connection timed out" 意味着连接超时。
检查一下是否添加了SSH密钥
cat ~/.ssh/id_rsa.pub
输出显示已经配置密钥了。
查阅资料后,解决问题方案如下:
在 C:\Users\Username\.ssh 目录下&#x