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

  • 相关阅读:
    HDU Railroad (记忆化)
    HDU 1227 Fast Food
    HDU 3008 Warcraft
    asp vbscript 检测客户端浏览器和操作系统(也可以易于升级到ASP.NET)
    Csharp 讀取大文本文件數據到DataTable中,大批量插入到數據庫中
    csharp 在万年历中计算显示农历日子出错
    csharp create ICS file extension
    CSS DIV Shadow
    DataTable search keyword
    User select fontface/color/size/backgroundColor设置 字体,颜色,大小,背景色兼容主流浏览器
  • 原文地址:https://www.cnblogs.com/lshilin/p/7691105.html
Copyright © 2011-2022 走看看