©CC BY-NC-SA 4.0

频道: cx.ms/channel
笔记: cx.ms/memo
博客: cx.ms/blog
剪贴: cx.ms/clip
社交: cx.ms/sns
用 443 端口的 SSH 连接 GitHub

22 端口可能会由于各种原因被防火墙, 流量代理, 甚至网络运营商屏蔽. 造成连接到 git 仓库进行远程操作时出现连接关闭:
kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

GitHub 支持使用 443 端口进行 SSH 连接, GitHub Enterprise Server 不受支持:
在 HTTPS 端口使用 SSH - GitHub 文档
只需要对现有的 SSH 本地配置进行修改, 在 Host 条目下将 HostName 从 github.com 变更为 ssh.github.com, 添加选项 Port 值为 443, 如:
# Work account-1
Host github.avatar
   HostName ssh.github.com
   Port 443
   User git
   IdentityFile ~/.ssh/id_rsa_avatar

#git #GitHub

via CXPLAY's Memos
 
 
Back to Top