3 生成SSH公钥

$ ssh-keygen -t rsa -C "your_email@youremail.com" 
#ssh-keygen -t dsa -C "your_email@youremail.com"
 
# Creates a new ssh key using the provided email Generating public/private rsa key pair. 
Enter file in which to save the key (/home/you/.ssh/id_rsa):

现在你可以看到,在自己的目录下,有一个.ssh目录,说明成功了

3.1 输入github密码

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

这个时候输入你在github上设置的密码。

3.2 然后在.ssh中可以看到

Your identification has been saved in /home/you/.ssh/id_rsa. 
# Your public key has been saved in /home/you/.ssh/id_rsa.pub.
# The key fingerprint is: 
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@youremail.com
 
4 添加SSH公钥到github

打开github,找到账户里面添加SSH,把idrsa.pub内容复制到key里面。

5 测试是否生效

使用下面的命令测试

ssh -T git@github.com

当你看到这些内容放入时候,直接yes

The authenticity of host 'github.com (207.97.227.239)' can't be established.

RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. 
Are you sure you want to continue connecting (yes/no)?

看到这个内容放入时候,说明就成功了。

Hi username!

You've successfully authenticated, but GitHub does not provide shell access.
 
 
Note: if the original key is rsa format key, we need to generate dsa formate key

How to generate ssh key only for github and not conflict with original key的更多相关文章

  1. git配置ssh key并从github.com拉取repos

    一.配置ssh key 1. 进入当前用户目录cd ~2. 生成ssh keyssh-keygen -t rsa -C "ABC@qq.com"ABC@qq.com账号必须是你登录 ...

  2. GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)

    问题情况 本来一直用的是github的客户端,结果现在上传的时候出问题了,去网站上看,新项目已经创建,但是代码却怎么都上传不上去.于是只好用命令行的方式解决. Tortoisegit上是这样说的: g ...

  3. 怎样配置git ssh连接,怎样在GitHub上加入协作开发人员,怎样配置gitignore和怎样在GitHub上删除资源库.

    **********1.在运行git push origin master指令时报例如以下错误: iluckysi@ILUCKYSI-PC /d/ilucky/message/code (master ...

  4. ssh: connect to host github.com port 22: Connection refused

    假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...

  5. 初次使用git配置以及git如何使用ssh密钥(将ssh密钥添加到github)

    初次安装git配置用户名和邮箱 初次安装git需要配置用户名和邮箱,否则git会提示:please tell me who you are. 你需要运行命令来配置你的用户名和邮箱: $ git con ...

  6. 转Git配置SSH,并Push到GitHub上的相关流程

    首先,你可以试着输入git,看看系统有没有安装Git $ git The program 'git' is currently not installed. You can install it by ...

  7. git clone遇到的[ssh: connect to host github.com port 22]

    起因 在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github. 过程 这台电脑是新电脑,所以需要先本地生成ssh key:ssh-keygen -t rsa -C ...

  8. 生成SSH秘钥连接github(详细教程)

    第一步.首先,检查下自己之前有没有已经生成: 在开始菜单中打开git下的git bash(当然,在其他目录下打开git bash也是一样的): 然后执行 cd ~/.ssh 第二步.如果能进入到.ss ...

  9. Git复习(二)之远程仓库、注册GitHub账号、SSH警告、使用GitHub

    远程仓库 Git是分布式版本控制系统,同一个Git仓库,可以分布到不同的机器上.怎么分布呢?最早,肯定只有一台机器有一个原始版本库,此后,别的机器可以“克隆”这个原始版本库,而且每台机器的版本库其实都 ...

随机推荐

  1. MFC listcontrol 分列 添加行数据 点击列头排序

    适用于 对话框程序 1.在工具箱中拖出 ListControl,然后右键-属性,view-Report 让你的ListControl变成这幅模样! 2.添加ListControl控件的control类 ...

  2. 解决ADT升级报错

    方法一: 将https://dl-ssl.google.com/android/eclipse/ 改成 http://dl-ssl.google.com/android/eclipse/: 方法二: ...

  3. 快学Java NIO 续篇

    可以先看Java NIO的整体介绍,这篇接着说以下内容,<快学Java NIO>续篇 FileChannel SocketChannel ServerSocketChannel Java ...

  4. HDOJ-1002

    用java写大数,感觉就是BUG import java.math.*; import java.io.*; import java.util.*; public class Main{ public ...

  5. 【转】敏捷开发 Scrum 总结

    转:http://www.open-open.com/lib/view/open1330413325514.html 最近把之前学习 Scrum 的资料整理为一篇文档,在接下来的团队和项目开发中,根据 ...

  6. POJ 1222 (开关问题+高斯消元法)

    题目链接: http://poj.org/problem?id=1222 题目大意:一堆开关,或开或关.每个开关按下后,周围4个方向开关反转.问使最后所有开关都关闭的,开关按法.0表示不按,1表示按. ...

  7. ACM D的小L

    D的小L 时间限制:4000 ms  |  内存限制:65535 KB 难度:2   描述       一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给 ...

  8. 1204. Maze Traversal

    1204.   Maze Traversal A common problem in artificial intelligence is negotiation of a maze. A maze ...

  9. HDU 4003 Find Metal Mineral(分组背包+树形DP)

    题目链接 很棒的一个树形DP.学的太渣了. #include <cstdio> #include <string> #include <cstring> #incl ...

  10. 'Could not load NIB in bundle: 'NSBundle xxx/storeFlix.app> ' with name 'UIViewController-w6Q-ra-j06' and directory 'StoreFlixIpad.storyboardc

    1.此代码是从 git clone xxx 下载的. 2.使用 sourcetree 下载即可解决此问题.