1 如果没有安装ssh,那么使用下面的指令

sudo apt-get install ssh

2 检查SSH公钥

cd ~/.ssh

看看存不存在.ssh,如果存在的话,掠过下一步;不存在的请看下一步

3 生成SSH公钥

$ ssh-keygen -t rsa -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.

使用git bush 生成github SSH公钥的更多相关文章

  1. win下如何生成 github ssh公钥 GIT

    1. 安装git,可以去官网下最新的,但由于局域网问题,我们百度git即可,一般版本也比较新: 2. 一路默认下一步,安装成功后,从程序目录打开 "Git Bash": 3. 输入 ...

  2. windows下如何github ssh 公钥

    windows下如何github ssh 公钥   1. 安装git,从程序目录打开 "Git Bash"  2. 键入命令:ssh-keygen -t rsa -C " ...

  3. 生成&添加 SSH公钥

    生成&添加 SSH公钥 生成 打开 Terminal(终端) 生成命令 ssh-keygen -t ed25519 -C "your_email@example.com" ...

  4. 全面概述Gitee和GitHub生成/添加SSH公钥

    前言 现如今将代码开源已经成为软件开发行业的一种趋势,而现在比较有名的代码托管平台有GItHub.Gitee.Gitlab等相关平台.而我们在使用代码托管平台最为常见的就是如何将自己本地的代码推送到远 ...

  5. Git密钥生成步骤SSH Key

    顺便推荐下自己的网站: 一个php后台极速开发框架 https://www.lotusadmin.top/ 一个有趣的网站 https://www.waytomilky.com/ Git是分布式的代码 ...

  6. git使用多个SSH公钥信息

    常常在开发环境存在多个git库,比如官方的github.公司搭建的gitlab.自己的私人库等等多个git库,为了方便使用,git需要配置多个SSH公钥信息. 在centos7.5下,进入用户目录,以 ...

  7. git基础之创建ssh公钥和密钥

    用git管理过程中,不想每次输入username和password.解决的方法例如以下; 1 . 链接换成ssh协议. 2 . 生成公钥. 3. 加入ssh公钥到gitserver. 打开gitbas ...

  8. 开源中国社区 https://git.oschina.net/ 添加 SSH 公钥 添加

    首先可以参考官方的帮助文档 http://git.mydoc.io/?t=154712 然后进去码云首页 http://git.oschina.net 然后找到右边的头像点击一下  然后点击修改资料 ...

  9. 配置github SSH公钥登录

    git的安装见https://www.cnblogs.com/liliyang/p/9829931.html 配置git使用ssh密钥 git支持https和git两种传输协议,github分享链接时 ...

随机推荐

  1. angularJS的过滤器!

    angularJS过滤器: filter currency date filter json limitTo lowercase number orderBy uppercase ...... Fil ...

  2. python range函数与numpy arange函数

    1.range()返回的是range object,而np.arange()返回的是numpy.ndarray() range尽可用于迭代,而np.arange作用远不止于此,它是一个序列,可被当做向 ...

  3. postgresql----数据库表约束----PRIMARY KEY

    五.PRIMARY KEY ---- 主键约束 主键可以是单个字段,也可以是多个字段的组合.主键约束其实是UNIQUE和NOT NULL约束的组合,即主键必须是唯一,且各字段都是NOT NULL的. ...

  4. Requested bean is currently in creation: Is there an unresolvable circular reference?

    spring容器初始化报错:循环依赖,错误信息如下: Requested bean is currently in creation: Is there an unresolvable circula ...

  5. mysql数据库多源复制方案

    概述 由于目前生产环境的mysql数据库分布在两台服务器,若从单一主从来看,配置很简单,但是需要将两台服务器的数据库同步到一台从库上面,需要进行更多配置和注意事项.多源复制有两种方案,Binlog+P ...

  6. jQuery至上宝典

    一 jQuery是什么? <1> jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多 javascript高手加入其team. <2>jQuery是继 ...

  7. 【spring mvc】application context中【bean】的生命周期

    生命周期过程 主要分为四部分: 一.实例化 1. 当调用者通过 getBean( name )向 容器寻找Bean 时,如果容器注册了org.springframework.beans.factory ...

  8. 006-markdown基础语法

    1.标题 # 这是一级标题 ## 这是二级标题 ### 这是三级标题 #### 这是四级标题 ##### 这是五级标题 ###### 这是六级标题 2.字体 *这是倾斜的文字* **这是加粗的文字** ...

  9. LockSupport HotSpot里park/unpark的实现

    每个java线程都有一个Parker实例,Parker类是这样定义的: class Parker : public os::PlatformParker { private: volatile int ...

  10. xmr monero miner

    https://github.com/fireice-uk/xmr-stak-cpu xmr-stak-cpu安装 xmr-stak-cpu是一个用于cpu计算的开源软件,下面记录在ubuntu17. ...