💡 参考文章见Ref,感谢提供思路!
🗺️当前这篇博文地址:https://myoontyee.github.io/article/b1a1bc5b.html
⚠️警告:博客文章禁止一切形式的非授权非法转载!
⚠️Attention: All forms of unauthorized illegal reposts are prohibited !

创建时间:2022年4月30日12:45:27
最新更新:2022年4月30日12:50:02


Problem Description:Hexo reports ssh: connect to host github.com port 22: Connection timed out error solution

核心思路ssh部署不上去,换https


  • 很骚,我在实验室的网就行,用热点也行,神特么到寝室就不行了
  • 简单来说,ssh部署不上去,咱们就不走ssh,换https,妈妈的

报错全文

1
2
3
4
5
6
7
8
9
10
11
12
13
14
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL {
err: Error: Spawn failed
at ChildProcess.<anonymous> (..\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:520:28)
at ChildProcess.cp.emit (..\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
code: 128
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

解决

  • 用代码编辑器打开_config.yml,你项目根目录下的,有deploy的那个,将repo后面的ssh路径改为https路径,比如https://github.com/+你的仓名
修改前
修改后
1
repo: git@github.com:你的仓
1
repo: https://github.com/你的仓

Ref