如何给 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. Uber如何解决2000多个微服务带来的复杂性问题?

    Uber如何解决2000多个微服务带来的复杂性问题? Adam Gluck 架构头条 2020-10-29 https://mp.weixin.qq.com/s/N7fVDZVm8uC9wVvd9DQ ...

  2. Python基础(列表中变量与内存关系)

    在Python中,copy的是内存地址,引用的是列表的引用地址,列表里存的是各个元素的地址 例如: name = [1,2,3,4,['xfxing','summer',6]] n2 = name.c ...

  3. JavaScript this 关键字详解

    一.前言 this关键字是JavaScript中最复杂的机制之一.它是一个很特别的关键字,被自动定义在所有函数的作用域中.对于那些没有投入时间学习this机制的JavaScript开发者来说,this ...

  4. 编程排序的一个excel-据说玩的好的,年薪50万了。只是你没在对的地方

    是一个excel 下面是百度网盘分享地址; http://pan.baidu.com/s/1kTwqRfL    

  5. CPU中的程序是怎么运行起来的(预告篇)

    总述     最近一位朋友问我,我开发的代码是怎么运行起来的,我就开始给他介绍代码的预编译.汇编.编译.链接然后到一般的文件属性,再到代码运行.但是大佬问了我一句,CPU到底是怎么执行到每一个逻辑的, ...

  6. unix环境高级编程第六章笔记

    口令文件 阴影口令 组文件 附属组ID 登录账户记录 系统标识 口令文件<\h2> /etc/passwd文件是UNIX安全的关键文件之一.该文件用于用户登录时校验用户的口令,文件中每行的 ...

  7. 2019牛客暑期多校训练营(第十场)E-Hilbert Sort(分形)

    >传送门< 题意 现给出你 $n $个坐标和 $k$,让你根据$ k$阶 希尔伯特曲线的走向排列给出的 $n $个坐标 希尔伯特曲线如下:  $k=1$ $k=2$ $k=3$可以将边长为 ...

  8. Codeforces Global Round 8 C. Even Picture(构造)

    题目链接:https://codeforces.com/contest/1368/problem/C 题意 构造一个只含有灰.白块的网格,要求: 所有灰块为一个连通块 每个灰块与偶数个灰块相邻 恰有 ...

  9. Codeforces Round #628 (Div. 2) C. Ehab and Path-etic MEXs(树,思维题)

    题意: 给有 n 个点的树的 n-1 条边从 0 到 n-2 编号,使得任意两点路径中未出现的最小数最小的方案. 思路: 先给所有度为 1 的点所在边编号,之后其他点可以随意编排. #include ...

  10. Codeforces Round #681 (Div. 2, based on VK Cup 2019-2020 - Final) B. Saving the City (贪心,模拟)

    题意:给你一个\(01\)串,需要将所有的\(1\)给炸掉,每次炸都可以将一整个\(1\)的联通块炸掉,每炸一次消耗\(a\),可以将\(0\)转化为\(1\),消耗\(b\),问将所有\(1\)都炸 ...