0
点赞
收藏
分享

微信扫一扫

ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote 报错解决


问题描述:

git push 或 git pull 到 github项目,遇到如下报错,

ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决办法:

在SSH配置文件中,设置github的主机名为 ssh.github.com 设置443端口

vim ~/.ssh/config

复制如下代码到config文件

Host github.com
Hostname ssh.github.com
Port 443

保存退出后,运行git pull ,提示Please type ‘yes’, ‘no’ or the fingerprint: ,输入yes,大功告成!


举报

相关推荐

0 条评论