簡體   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