【发布时间】:2020-04-29 00:54:32
【问题描述】:
公司防火墙只允许 https 连接到 github.com(没有 ssh),所以我添加了这样的存储库:
git remote add origin https://github.com/myProject.git
不幸的是,如果我打电话给git push,github 会询问我的用户名和密码。我已经使用ssh-keygen 创建了一个 ssh 密钥。
如何在 https 存储库中使用 SSH 密钥?
我试过SSh over HTTPS:
ssh -T -p 443 git@ssh.github.com
但我收到此错误:
ssh: connect to host ssh.github.com port 443: Connection refused
【问题讨论】:
-
不是
SSH over HTTPS,而是SSH over the HTTPS port。协议仍然是 SSH,只是使用的端口从 22 更改为 443。