繁体   English   中英

SSH 密钥使用 Git

[英]SSH key using Git

我是 GitHub 的新手,在遵循本教程之后,我试图了解 SSH 键。

我已经创建了一个密钥并将其添加到我的帐户中。 目前我只有几个测试存储库,我在本地克隆它们。

现在,问题是,即使我没有设置我的ssh-agent (或者我从 GitHub 中删除了所有密钥),我仍然可以更新我的存储库并推送给它们。

The only thing I can't do with a verified key is cloning a repository using the SSH link (eg git@github.com:username/repository.git ), but I can still clone and push to repositories using the https link (eg https://github.com/username/repository.git )。

我最初认为可以使用 https 进行克隆,但我无法推送,但我什至可以推送,而且它不会询问任何用户名密码!

那么,SSH 密钥的目的是什么,如果有人仍然可以做与我使用经过验证的密钥相同的事情? 它与特权和权限有关吗?

但我仍然可以使用 https 链接(例如https://github.com/username/repository.git )克隆并推送到存储库。

When using HTTPS, you would not use any SSH key, only cached credentials (GitHub account username/password), that would be provided by the git credential helper ( git config credential.helper )

printf "protocol=https\nhost=github.com"|git credential-xxx erase

git config credential.helper返回的助手替换 xxx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM