zoukankan      html  css  js  c++  java
  • git/github 生成密钥

    一 .  github上创建立一个项目

      用户登录后系统,在github首页,点击页面右下角“New Repository”

      填写项目信息:

      project name: hibernate-demo  

      description : my first project

      点击“Create Repository” ; 现在完成了一个项目在github上的创建。

    二  .  创建密钥

      (1).配置用户名和邮箱(如果已经配置,就跳过)

        git config –global user.name ‘xxxxx’ 
        git config –global user.email ‘xxx@xx.xxx’

       (2).检查下自己之前有没有已经生成shh

            cd ~/.ssh

          如果能进入到.ssh文件目录下 ,则证明,之前生成过.ssh秘钥,可以直接使用里面的秘钥。 

      (3).生成秘钥 

          ssh-keygen -t rsa -C ‘xxx@xx.xxx’ //配置的邮箱

          接着按3个回车 :      

     1 Generating public/private rsa key pair.
     2 Enter file in which to save the key (/c/Users/Mr.Yang/.ssh/id_rsa):
     3 Enter passphrase (empty for no passphrase):
     4 Enter same passphrase again:
     5 Your identification has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.
     6 Your public key has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.pub.
     7 The key fingerprint is:
     8 SHA256:zA6wNJrFB6NcqS6eBog/AHlzQuvFjYpG759Yhh1lWGI xxxxxx@xxxxx.xxx(上面自己的邮箱)
     9 The key's randomart image is:
    10 +---[RSA 2048]----+
    11 |    +E .         |
    12 | ..+oo+          |
    13 | oo+*+.o         |
    14 |o.*===+o         |
    15 |==+*... S        |
    16 |B.+.o .o         |
    17 |++o. +  .        |
    18 | +o.+ .          |
    19 |.  o.o           |
    20 +----[SHA256]-----+
      最后在.ssh目录下得到了两个文件:id_rsa(私有密钥)和id_rsa.pub(公有密钥)

       .  将公有密钥添加到github SSH keys

        使用记事本等软件打开id_rsa.pub文件,将里面的内容复制,粘贴到github的New SSH key

    四 .验证是否连接成功

      $ ssh git@github.com

  • 相关阅读:
    bzoj2946 [Poi2000]公共串(SA,SAM)
    77 最长公共子序列
    C++ lower_bound 与 upper_bound 函数
    76 最长上升子序列
    75 寻找峰值
    C++标准输入问题
    74 第一个错误的代码版本
    73 前序遍历和中序遍历树构造二叉树
    72 中序遍历和后序遍历树构造二叉树
    71 二叉树的锯齿形层次遍历
  • 原文地址:https://www.cnblogs.com/lshilin/p/7691105.html
Copyright © 2011-2022 走看看