• 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)

  • 相关阅读:
    [Erlang05]gen_server怎么去写eunit?
    [Erlang04]为什么有了rpc还有net_kernel:connect/1?
    [Erlang03]Erlang有哪些好用的静态分析工具?
    [SIP01]SIP Header Fields里面各字段用途
    [SIP00]SIP 概念总结
    [Erlang00]:gen_server:reply/2
    Makefile教程
    Linux 环境下开发 STM32
    Ubuntu 18.04 + ROS Melodic + TurtleBot3仿真
    Ubuntu系统鼠标不能点击
  • 原文地址:https://www.cnblogs.com/clis/p/14288190.html
Copyright © 2020-2023  润新知