ssh: connect to host github.com port 22: Connection refused
是連接github.com的端口號22拒絕連接。
可以使用github的443端口。文章來源:http://www.zghlxwxcb.cn/news/detail-815062.html
解決方案
- 在
~/.ssh/config
中添加如下字段:
$ vim ~/.ssh/config
# 如果沒有config 文件就新建一個(gè)
Host github.com
Hostname ssh.github.com
Port 443
- 測試是否鏈接成功
ssh -T git@github.com
如果出現(xiàn)如下字段則驗(yàn)證成功
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.文章來源地址http://www.zghlxwxcb.cn/news/detail-815062.html
到了這里,關(guān)于解決ssh: connect to host github.com port 22: Connection refused的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!