windows解决ssh: connect to host github.com port 22: Connection refused
时间: 2023-12-21 08:02:04 浏览: 239
在Windows上解决"ssh: connect to host github.com port 22: Connection refused"的问题有几个解决方案。首先,你可以尝试在你的本地SSH配置文件中更改端口号为443。你可以在C:\Users\Username\.ssh目录下新建一个config文件,文件内容如下:
Host github.com
User <Your email>
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
此外,你还可以尝试在远程库的地址中将端口号修改为443。在你的git远程库地址中,将"git@github.com"修改为"git@ssh.github.com",然后再次尝试push代码到远程库。
最后,如果以上方法都无效,你可以尝试使用HTTPS协议进行连接。在你的本地git仓库中,将远程库的地址修改为HTTPS格式,例如"https://github.com/username/repository.git",然后再次尝试push代码到远程库。
希望以上解决方案能够帮助你解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Windows下解决ssh: connect to host github.com port 22: Connection refused](https://blog.csdn.net/qq_52293358/article/details/124535927)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文