1. 程式人生 > 其它 >Github——生成自己的SSH KEY 並填入配置中

Github——生成自己的SSH KEY 並填入配置中

Github——生成自己的SSH KEY 並填入配置中

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