一次hexo deploy失败的修复过程

• 3 分钟阅读 • web

今天突然就发现hexo -d执行出错,看输出是ssh认证出问题了。本文记录了修复过程。

出错提示

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 Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
    at ChildProcess.<anonymous> (D:\hexo\blog\node_modules\hexo-deployer-git\node_modules\hexo-util\lib\spawn.js:51:21)
    at ChildProcess.emit (node:events:518:28)
    at cp.emit (D:\hexo\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)

问题出在ssh认证上。

修复过程(windows 10平台)

Host github.com
  Hostname ssh.github.com
  User git
  Port 443
  IdentityFile ~/.ssh/id_rsa

测试

cmd命令行提示下执行:
ssh -T git@github.com
输出为:

The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[ssh.github.com]:443,[20.205.243.160]:443' (ECDSA) to the list of known hosts.
Hi qs100371! You've successfully authenticated, but GitHub does not provide shell access.

认证成功。
再执行hexo -d就没有错误提示了。


时间能磨灭一切,之前会的,后面会忘记,记录下来,再出现同样的问题就可以照做了。

文章标签: web

上一篇 : 网盘搜索PanHub
下一篇 : Web ssh客户端Nexus Terminal
留言
阅读进度 0%