zoukankan      html  css  js  c++  java
  • Git 配置SSH公钥、私钥

    开篇日常立个flag....

    安装Git

    此处略去一万字

    了解几个东西

    为什么要配置公钥、私钥?配置了有什么用(对于Git)?怎么配置?

    (以后补充)

    Git 配置SSH公钥、私钥

    1、进入Git Bash

    鼠标右键<Git Bash Here>(或者文件路径里敲<Git Bash.lnk>)

    2、输入生成 Rsa 秘钥对的命令

    ssh-keygen -t rsa -C "your_email@example.com"

    3、秘钥名称

    Enter file in which to save the key (/c/Users/CL/.ssh/id_rsa): <输入秘钥名称/直接回车>

    注:本例中,输入秘钥名称为:lisheng741

    4、输入密码和确认密码

    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:

    都可空,直接回车,等待生成秘钥对。

    本地会生成两个文件:

    lisheng741     私钥

    lisheng741.pub   公钥

    5、本地添加私钥

    ssh-add <私钥路径>

    6、读取公钥

    方式1:cat <公钥文件>

    方式2:以文本方式打开公钥文件

    将公钥文本复制,用于下一步

    7、在 Github / Gitee 添加公钥

    Github:点自己头像 >> Settings >> SSH and GPG keys >>New SSH key 

    Gitee:点自己头像 >> 设置 >> SS公钥 

    参考来源

    https://blog.csdn.net/july_young/article/details/82712574 (july_young 的 git添加私钥)

    https://www.cnblogs.com/kaerxifa/p/11164206.html (wangju003 的 git配置密钥(私钥、ssh、公钥))

    Git配置SSH公钥、私钥 踩坑记录

    第5步本地添加私钥时,提示:

    Could not open a connection to your authentication agent.

    具体原因没有细究,解决方案:先执行命令:ssh-agent bash

    参考来源

    https://www.cnblogs.com/sheldonxu/archive/2012/09/17/2688281.html (Sheldon Xu 的 执行ssh-add时出现Could not open a connection to your authentication agent)

  • 相关阅读:
    PointToPointNetDevice doesn't support TapBridgeHelper
    NS3系列—10———NS3 NodeContainer
    NS3系列—9———NS3 IP首部校验和
    NS3系列—8———NS3编译运行
    【习题 7-6 UVA
    【Good Bye 2017 C】 New Year and Curling
    【Good Bye 2017 B】 New Year and Buggy Bot
    【Good Bye 2017 A】New Year and Counting Cards
    【Educational Codeforces Round 35 D】Inversion Counting
    【Educational Codeforces Round 35 C】Two Cakes
  • 原文地址:https://www.cnblogs.com/clis/p/14288190.html
Copyright © 2011-2022 走看看