0%

报错日志记录

Hexo

在添加openssh成功后,hexo d报错:

1
2
3
4
5
6
7
8
9
10
11
12
ssh: Could not resolve hostname github.com: \262\273\326\252\265\300\325\342\321\371\265\304\326\367\273\372\241\243
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\CrfBlog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (D:\Hexo\CrfBlog\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)

报错时间:2024.03.08

解决方案

尝试ssh -T git@github.com或用小乌龟推送项目到github,报错:

1
2
3
4
git.exe push --progress "private" master:master
kex_exchange_identification: Connection closed by remote host
Connection closed by 140.82.114.3 port 22
fatal: Could not read from remote repository.

想起来昨天测试openssh时把config文件删除,重新在私钥文件夹~/.ssh/下创建config文件
,并添加规则开放443端口:

1
2
3
Host github.com
Hostname ssh.github.com
Port 443

再次测试推送ssh -T git@github.com,输入yes,成功:

1
2
3
4
5
6
7
8
$ ssh -T git@github.com
The authenticity of host '[ssh.github.com]:443 ([140.82.112.35]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[ssh.github.com]:443' (ED25519) to the list of known hosts.
Hi Aoce888! You've successfully authenticated, but GitHub does not provide shell access.

重新hexo d,问题解决。

归因:误删~/.ssh/下config,导致github配置错误,无法ssh链接到git服务器。

Git

~

-------------本文结束感谢您的阅读-------------