git - 无法 SSH -T git@github.com
问题描述
我一直在尝试在我的 PC(Ubuntu 20.04)上使用 SSH(git clone)连接 GitHub。
0. Installed SSH, git
1. Created SSH-key under ~/.SSH/
2. Submit my id_rsa.pub key to GitHub
3. SSH -T git@github.com <- Did not work
4. SSH -vT git@github.com <- Didn't work
6. SSH git@github.com <- It worked
7. git clone ~ <- Did not work
当我执行 SSH -T git@github.com 时,它不起作用。
Error Messages:
Connection to github.com closed by remote host.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
终端显示“远程主机关闭与 github.com 的连接”
但是当我尝试 SSH git@github.com 时,它可以工作并且终端显示 Hi, username =。
然后我尝试了 git clone (我的 GitHub 存储库),但终端说“请确保您有正确的访问权限~”。
我的 SSH 连接有什么问题?
解决方案
请注意(对于其他读者)路径是区分大小写的(除非您在 Windows 上),这意味着 SSH 密钥在 下~/.ssh
,而不是~/.SSH
URL 应该是:
git clone git@github.com:<user>/<reponame>
同样,区分大小写:仔细检查远程存储库的 URL。
推荐阅读
- java - 如何在 ColdFusion 中使用 jargon2-api?
- docker - SIOCDDRT:不允许操作
- c - 启用分页后出现页面错误?操作系统开发
- mysql - 基于同一表中的另一列更新列中的值
- griddb - 在 Windows 平台上安装“GridDB python 客户端”时在哪里设置 SWIG_RESOURCE 的路径
- python - TensorBoard tf.cond 性能
- c# - 将 C++ DLL 指向函数的指针导入 C#
- pgadmin-4 - pgadmin4 查询工具编辑器在执行后不起作用
- wordpress - 从 Wordpress、Woocommerce 添加类别页面中的正常选择创建 Select2
- web-services - 以 RESTful 方式调用轴 2 Web 服务时出现名称空间不匹配错误