使用git生成ssh公鑰步驟

2021-08-22 04:31:52 字數 848 閱讀 5916

1、開啟"git bash",右鍵桌面或者通過"開始"開啟

2、輸入指令,進入.ssh資料夾

指令:cd ~/.ssh/

如果本地沒有.ssh資料夾,則輸入新建資料夾指令:mkdir ~/.ssh 

3、生成key

輸入以下指令,生成公鑰:ssh-keygen -t rsa -c "***@qq.com"

ssh-keygen -t rsa -c "你的email位址"

#**引數含義:

#-t指定金鑰型別,預設是rsa,可以省略。

#-c設定注釋文字,比如郵箱。

#-f指定金鑰檔案儲存檔名。

生成的公鑰如下:

輸入指令後,可一直按回車,預設生成的檔名為 id_rsa,當然你也可以修改為自己想要的檔名(注意為全路徑,如要生成github_sample_rsa,則輸入  c:\users\dell\.ssh\github_sample_rsa)。密碼可不輸入直接回車。

Git生成 SSH 公鑰

1.生成ssh公鑰 ssh keygen t rsa c xx xx.com 1.三次回車即可生成 ssh key 2.引號中的為碼雲註冊的郵箱 3.windows中使用ssh keygen 桌面右鍵選擇gui bash here 檢視生成的public key cat ssh id rsa.pub...

Git生成SSH公鑰

一般情況下,ssh的金鑰儲存在使用者的 ssh目錄下,我們進入這個目錄,可以看到我們是否擁有金鑰。cd ssh ls我的系統是新裝的ubuntu 18.04.1 lts。裡面什麼都沒有。我們需要尋找一對以id dsa或者id rsa命名的檔案,其中乙個帶有.pub副檔名。pub檔案是你的公鑰,另乙個...

git生成ssh公鑰

記住使用者名稱和密碼 git config global credential.helper store 在user目錄下生成.git credentials檔案生成公鑰 ssh gitlab id rsa路徑 檔名 ssh keygen t rsa c x com f ssh gitlab id ...