抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

提交文章发生了奇怪的错误

突然的错误

我今天进行提交新的博文,突然提交不上去,
报错如图

1
prot 22: Operation timed out

初步判断为端口问题,那么除了ssh端口我们还可以用https 443端口

解决方法

博主本机为win10,那么在/git/etc/ssh/ssh_config文件末尾增加

1
2
3
4
5
6
Host github.com
User YourEmail@xx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

然后保存。
然后继续在git bash中使用

1
2
git config --global user.name "XXX"
git config --global user.email xxxx@xx.com

刷新就可以生效


linux中在~/.ssh新建config输入以下内容

1
2
3
4
5
6
Host github.com
User YourEmail@xx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

后续内容跟上面内容一样更新即可。最后运行ssh -T git@github.com,查看是否连接成功。

评论