如何给 GitHub 添加  SSH key, 如何生成  SSH key 详细图文教程!

一、 生成  SSH key

https://ide.c9.io/xgqfrms/

创建一个空项目:(或使用真实 Linux 主机) PS: windows 类似(? CMDReadMore

https://ide.c9.io/xgqfrms/demo

打开 shell(bash), 输入:

$ npm install -g git-it

生成 SSH-Key

$ ssh-keygen -t rsa -b 4096 -C "username@email.com"

检查,添加 ssh-key 到,linux client:

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa

复制 ssh-key public 到 剪切板:

$ clip < ~/.ssh/id_rsa.pub

如果不好使, 使用vim 打开,复制即可!

$ cd /home/ubuntu/.ssh/

$ ls -l

$ vim id_rsa.pub

PS: 退出 vim 方法:

1. 点击 esc 键,进入vim命令模式 输入 :q

:q

2. 点击 Enter 即可退出!

NEW:   after add ssh key ,you should close the terminal & restart a new terminal!

二、 给 GitHub 添加  SSH key

1. 打开 设置>SSH and GPG Keys> New SSH key ,

2. 将复制的 id_rsa.pub 的 key 值,粘贴到 key 文本框,点击 Add SSH key 即可!

ok!

NEW:   after add ssh key ,you should close the terminal & restart a new terminal!

1

Checking for existing SSH keys

https://help.github.com/articles/checking-for-existing-ssh-keys/#platform-linux

Adding a new SSH key to your GitHub account

https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

1

Multi Account for GitHub!

new path

创建 config,配置 multi account for GitHub!
touch config
编辑 config
vim config

NEW:   after add ssh key ,you should close the terminal & restart a new terminal!

1

1

Generating a new SSH key and adding it to the ssh-agent

After you've checked for existing SSH keys, you can generate a new SSH key to use for authentication, then add it to the ssh-agent.

Generating a new SSH key

  1. Open Terminal.

  2. Paste the text below, substituting in your GitHub email address.

    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    # Creates a new ssh key, using the provided email as a label
    Generating public/private rsa key pair.
  3. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

    Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
    

    using new path in case of override your other SSH-keys
     Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]

    $ Enter a file in which to save the key (/Users/you/.ssh/id_rsa): /Users/you/.ssh/id_rsa_github [Type a passphrase]
    
  4. At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".

    Enter passphrase (empty for no passphrase): [Type a passphrase]
    Enter same passphrase again: [Type passphrase again]

Adding your SSH key to the ssh-agent

Before adding a new SSH key to the ssh-agent, you should have checked for existing SSH keys andgenerated a new SSH key.

  1. Ensure ssh-agent is enabled:

    # start the ssh-agent in the background
    $ eval "$(ssh-agent -s)"
    Agent pid 59566
  2. Add your SSH key to the ssh-agent. If you used an existing SSH key rather than generating a new SSH key, you'll need to replace id_rsa in the command with the name of your existing private key file.

    $ ssh-add ~/.ssh/id_rsa
    
  3. Add the SSH key to your GitHub account.

1

 

如何给 GitHub 添加 SSH key, 如何生成 SSH key 详细图文教程!的更多相关文章

  1. 代码文档生成工具-Doxygen生成CHM和RTF图文教程

    Doxygen是一种开源跨平台的,以类似JavaDoc风格描述的文档系统,可以从一套归档源文件开始,生成chm格式的文档.本文主要讲解如何在winddows下安装doxygen.     1.下载do ...

  2. 转 SSH框架搭建详细图文教程

    原址:http://blog.sina.com.cn/s/blog_a6a6b3cd01017c57.html 什么是SSH? SSH对应 struts spring hibernatestruts ...

  3. SSH框架搭建 详细图文教程

    转载请标明原文地址 一.什么是SSH? SSH是JavaEE中三种框架(Struts+Spring+Hibernate)的集成框架,是目前比较流行的一种Java Web开源框架. SSH主要用于Jav ...

  4. SSH框架搭建详细图文教程(转)

    这篇文章看的我醍醐灌顶的感觉,比之前本科时候学习的SSH架构 要清晰数倍  非常感觉这篇博主的文章 文章链接为:http://blog.sina.com.cn/s/blog_a6a6b3cd01017 ...

  5. SSH框架搭建详细图文教程

    转载请标明原文地址:http://www.cnblogs.com/zhangyukof/p/6762554.html 一.什么是SSH? SSH是JavaEE中三种框架(Struts+Spring+H ...

  6. github版本库使用详细图文教程(命令行及图形界面版)

    投稿:mdxy-dxy 字体:[增加 减小] 类型:转载 时间:2015-08-06我要评论 今天我们就来学习github的使用,我们将用它来管理我们的代码,你会发现它的好处的,当然是要在本系列教程全 ...

  7. .NET文档生成工具ADB使用图文教程

    .NETv3.0 可再发行组件包 类型:编程辅助大小:2.7M语言:中文 评分:1.8 标签: 立即下载 ADB2.3使用指南 ADB2.3使用方法如下图所示: (1)主界面: (2)批量选择: 4. ...

  8. powerdesigner连接Mysql进行反向工程并生成word文档图文教程

    1 软件版本 windows7 64位 powerdesigner 15.1 Mysql 5.1.56 mysql-connector-odbc-3.51.30-winx64 对于mysql-conn ...

  9. [转载]SSH框架搭建详细图文教程

    http://www.cnblogs.com/hoobey/p/5512924.html

随机推荐

  1. C++ /Python 将视频中的片段转为图片

      配置OpenCV :项目名称->右击->属性 VC++目录 包含目录 放 ...\build\include ...\build\include\opencv   ...\build\ ...

  2. Struts 2学习(二)

    文章目录 @[toc] #动态结果 配置时不知道执行后的结果是哪一个,运行时才知道哪个结果作为视图显示给用户. #全局结果 全局就结果可满足一个包中多个Action共享一个结果. 全局结果位于pack ...

  3. Spark:常用transformation及action,spark算子详解

    常用transformation及action介绍,spark算子详解 一.常用transformation介绍 1.1 transformation操作实例 二.常用action介绍 2.1 act ...

  4. 数据库MySQL——SQL语句(命令)

    SQL语句分类 DCL (Data Control Language):数据控制语言:用来管理用户及权限 DDL(Data Definition Language):数据定义语言:用来定义数据库对象: ...

  5. G - 棋盘游戏

    小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的"车",并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放, ...

  6. hdu 6704 K-th occurrence(后缀数组+可持久化线段树)

    Problem Description You are given a string S consisting of only lowercase english letters and some q ...

  7. HDU4467 Graph【轻重点维护】

    HDU4467 Graph 题意: 给出一张染色图,\(n\)个点每个点是黑色或者白色,\(m\)条带权边,\(q\)次操作,有两种操作: 改变一个点的颜色 问所有边中两个端点的颜色为给定情况的边权和 ...

  8. Educational Codeforces Round 89 (Rated for Div. 2) C. Palindromic Paths(贪心)

    题目链接:https://codeforces.com/contest/1366/problem/C 题意 有一个 $n \times m$ 的 $01$迷宫,要使从 $(1,1)$ 到 $(n,m) ...

  9. P1903 [国家集训队]数颜色 / 维护队列 带修改莫队

    题目描述 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问.墨墨会向你发布如下指令: 1. Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔. 2 ...

  10. hdu 5316 Magician 线段树维护最大值

    题目链接:Magician 题意: 给你一个长度为n的序列v,你需要对这个序列进行m次操作,操作一共有两种,输入格式为 type a b 1.如果type==0,你就需要输出[a,b]区间内的美丽序列 ...