Connection reset by [server_ip] port 22 (hexo d 部署博客出错)

问题

在使用 hexo d 部署博客和使用 Git/Github 进行 git push -u origin master 时遇到了以下问题:

  git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
  Pushing to [email protected]:MaugerWu/MaugerWu.github.io.git

  Connection reset by 192.30.253.113 port 22

  fatal: sha1 file '<stdout>' write error: Broken pipe

  fatal: The remote end hung up unexpectedly
  fatal: The remote end hung up unexpectedly

解决

这表明 git 软件无法通过 SSH 连接到 Github:如果您的防火墙或 ISP 设置的防火墙阻止端口 22 上的 SSH 连接,通常会发生这种情况。一个快速的解决方法,尝试 Github 提供的HTTPS URL:

git remote add origin-https https://github.com/github.com:MaugerWu/MaugerWu.github.io.git

git push -u origin-https master

如果可以,那肯定是你的SSH端口被关闭了。 您可以继续使用此替代语法,尝试在您的计算机或 ISP 上取消阻止端口 22,或查看建议:http://stackoverflow.com/a/8081292/27310

参考

猜你喜欢

转载自www.cnblogs.com/wumz/p/9820314.html