Skip to content

[github] 免密碼 push/pull/clone 等操作專案

Published: at 05:56 AM (1 min read)

其實原理跟之前的免密碼登入一樣

透過公私鑰,可以建立彼此信任的連線。

首先在 Windows/Linux 輸入 ssh-keygen 產生公私鑰

ssh-keygen

預設會以 RSA 加密產生公私鑰

Enter file in which to save the key (/home/camel/.ssh/id_rsa): Enter (確認檔案放置位置)

Enter passphrase (empty for no passphrase): Enter (不設定密碼)

Enter same passphrase again: Enter (不設定密碼)

PS. Linux 會產生在家目錄、Windows 則會在 C:\Users\[username] 底下的 .ssh 資料夾

產生公鑰:.ssh/id_rsa.pub 產生私鑰:.ssh/id_rsa

將公鑰的檔案內容貼至 GitHubSettings。(如圖)

shh-key

這樣就可以免帳密 pull/push/clone 專案了!


Previous Post
[css] word-break、word-wrap(overflow-wrap) 及 white-space 的差別與用法
Next Post
[virtualbox] 橋接網路,讓 VM 與 host 在同一虛擬網段並可連外,互相存取彼此服務。