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

时间:2021-08-03
本文章向大家介绍Github——生成自己的SSH KEY 并填入配置中,主要包括Github——生成自己的SSH KEY 并填入配置中使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

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

  1. 生成ssh key
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  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.

原文地址:https://www.cnblogs.com/kbbnice/p/15094251.html