问题出现

开学注册了,最近写了篇博客文章想像往常一样部署服务器,但是出现了连接问题。以前从来没遇到过:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Connection reset by 我的主机IP port 22
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> (D:\uuanqin\Desktop\uuanqin-blogs\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:513:28)
at cp.emit (D:\uuanqin\Desktop\uuanqin-blogs\node_modules\cross-spawn\lib\enoent.js:34:29)
at 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

Process finished with exit code 2

想用 XShell 连上服务器看看,结果还是失败:

QQ截图20230910111157.png

终端使用 SSH 连接也不行:

QQ图片20230910111113.png

问题排查

经过排查发现:

  • 服务器公网 IP 可以 Ping 通
  • 安全组设置正确
  • 阿里云 Workbench 工具可以远程连接
  • 换学校热点、手机移动热点正常,唯独校园有线网连接出现异常

综上判断,有理由怀疑是阿里云屏蔽了一些 IP。

问题解决

打开阿里云控制台,点击右上角头像找到安全管控:

image.png
在 IP 白名单中添加当前 IP 即可。

image.png

image.png

后记

取消白名单后,过一段时间就又被ban咯,所以就让它一直存在吧。

本文参考