Hexo出现错误err: Error: Spawn failed
在 hexo d之后,出现如下代码:
1 | fatal: Could not read from remote repository. |
1 | ssh -T git@github.com |
使用上面的命令查看详细错误信息,得到以下结果
ssh: connect to host github.com port 22: Resource temporarily unavailable
2、解决方法
然后我们进入.ssh的配置目录查看,发现ssh目录里少了配置文件config。
找到原因后我们进入.ssh的目录,使用命令“touch config”创建一个配置文件,并写入你github的配置信息。(xxxxx@xx.com是你github的注册邮箱)
1 | Host github.com |
现在再使用ssh git@github.com查看与github的连接状态,可能出现错误Bad owner or permissions on
这是因为你创建的配置文件config的权限不够。所以我们需要修改其权限。使用下面命令。
1 | sudo chmod 600 config |
现在我们再尝试查看连接状态发现已经成功连接。
1 | root@BF100638:~/.ssh# ssh -T git@github.com |
接下来就可以成功的push你的代码到github了。
参考:https://gugeshenjineng.github.io/2021/07/02/hexo部署到GitHub出现的问题/