差異處
這裏顯示兩個版本的差異處。
下次修改 | 前次修改 | ||
tech:github_deploy_key [2021/08/06 19:20] – 建立 jonathan | tech:github_deploy_key [2021/08/06 21:10] (目前版本) – [Github 使用 Deploy Key 存取 repo] jonathan | ||
---|---|---|---|
行 1: | 行 1: | ||
====== Github 使用 Deploy Key 存取 repo ====== | ====== Github 使用 Deploy Key 存取 repo ====== | ||
- | 打算將私有 repo 提供唯獨權限給特定對象, | + | 打算將私有 repo 提供唯讀權限給特定對象, |
===== 建立 ssh key ==== | ===== 建立 ssh key ==== | ||
行 28: | 行 28: | ||
+----[SHA256]-----+ | +----[SHA256]-----+ | ||
</ | </ | ||
+ | |||
+ | ===== 設定 Github Deploy Key ===== | ||
+ | * 將剛剛產生的 pub 貼上 GitHub Deploy Key 內 < | ||
+ | * {{: | ||
+ | |||
+ | ===== 檢查 git ssh key ===== | ||
+ | * 確認剛剛產生的 key 是否在預設路徑 Exp. / | ||
+ | * < | ||
+ | * ++看檢查訊息|< | ||
+ | / | ||
+ | The authenticity of host ' | ||
+ | RSA key fingerprint is SHA256: | ||
+ | Are you sure you want to continue connecting (yes/ | ||
+ | Warning: Permanently added ' | ||
+ | Hi iii-org/ | ||
+ | </ | ||
+ | <WRAP center round tip 60%> | ||
+ | * 如果有多個 deploy key 採用不同檔名存放 Exp. / | ||
+ | * 可以在 ssh 後面加上 -i / | ||
+ | </ | ||
+ | |||
+ | ===== 執行 git clone ===== | ||
+ | * Exp. < | ||
+ | * ++看執行結果|< | ||
+ | / | ||
+ | Cloning into ' | ||
+ | Warning: Permanently added the RSA host key for IP address ' | ||
+ | remote: Enumerating objects: 17525, done. | ||
+ | remote: Counting objects: 100% (5563/ | ||
+ | remote: Compressing objects: 100% (2370/ | ||
+ | remote: Total 17525 (delta 3635), reused 4930 (delta 3011), pack-reused 11962 | ||
+ | Receiving objects: 100% (17525/ | ||
+ | Resolving deltas: 100% (11017/ | ||
+ | </ | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | * 如果是多個 Deploy Key 的設定方式, | ||
+ | Host devops-ui github.com | ||
+ | Hostname github.com | ||
+ | IdentityFile / | ||
+ | User iii-org | ||
+ | Host repo-b-shortname github.com | ||
+ | Hostname github.com | ||
+ | IdentityFile / | ||
+ | #User username-on-remote-machine | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
===== 參考網址 ===== | ===== 參考網址 ===== | ||
* [[https:// | * [[https:// | ||
+ | * https:// | ||
{{tag> | {{tag> |