ssh: connect to host github.com port 22: Connection refused
是连接github.com的端口号22拒绝连接。
可以使用github的443端口。文章来源:https://www.toymoban.com/news/detail-815062.html
解决方案
- 在
~/.ssh/config
中添加如下字段:
$ vim ~/.ssh/config
# 如果没有config 文件就新建一个
Host github.com
Hostname ssh.github.com
Port 443
- 测试是否链接成功
ssh -T git@github.com
如果出现如下字段则验证成功
The authenticity of host ‘[ssh.github.com]:443 ([20.205.243.160]:443)’ can’t be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘[ssh.github.com]:443,[20.205.243.160]:443’ (ECDSA) to the list of known hosts.
Hi githubName! You’ve successfully authenticated, but GitHub does not provide shell access.文章来源地址https://www.toymoban.com/news/detail-815062.html
到了这里,关于解决ssh: connect to host github.com port 22: Connection refused的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!