Github——生成自己的SSH KEY 並填入配置中
阿新 • • 發佈:2021-08-03
Github——生成自己的SSH KEY 並填入配置中
- 生成ssh key
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
- 重新指定sshkey 的路徑和重新命名,可不填,直接回車。但是:如果有多個git賬戶時,需要設定。
Enter file in which to save the key (C:\Users\Administrator/.ssh/id_rsa):C:\Users\Administrator/.ssh/test_id_rsa # 這裡是指定路徑和重新命名,如果有多個git賬戶時,需要設定
- 提示輸入安全密碼時,可以輸入金鑰,也可以直接回車:
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
# 直接回車即可
- 最後會生成如下內容:
Your identification has been saved in C:\Users\Administrator/.ssh/test_id_rsa
# 訪問C:\Users\Administrator/.ssh/ 資料夾,找到 test_id_rsa_pub 貼上內容到github 即可
- 開啟github,找到 頭像 => settings =>SSH and GPG keys => New SSH key => 輸入標題和貼上密碼 => add SSH key . (完成)。
- 如果有提示輸入密碼,請輸入您的github密碼確認。