Github-SSH连接超时连接失败解决方案

报错信息

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

解决方案

配置 config 文件(Win路径 C:\Users\你的用户名\.ssh 下)

Host github.com
    ProxyCommand "你的GIT路径\Git\mingw64\bin\connect.exe" -S 127.0.0.1:7890 %h %p
    HostName ssh.github.com
    User git
    Port 443

P.S.

  • ProxyCommand 需要设置科学一下 ,更换443端口(非必选)
  • 若出现 FATAL: Unable to connect to relay host 报错,可尝试只修改端口号
  • 若出现 Bad owner or permissions on .ssh/config ,则需要 将.ssh 文件夹的安全属性 “禁用继承” 后再添加当前账号并赋予完全控制权限

Github-SSH连接超时连接失败解决方案
https://元气码农少女酱.我爱你/39d12850675a/
作者
元气码农少女酱
发布于
2024年2月2日
许可协议