gitHub ssh密钥配置

  gitHub是一个代码托管服务的提供商,可以提供个人或者企业的代码托管,同时它也是一个巨大的开源社区。-- https://github.com/

  对于企业的代码协作,如果采用http的方式登录,那么每次进行需要交互的操作时,都必须输入账户密码,于是我们设置ssh key,只要安装好密钥,就不必这么麻烦啦。下面就是生成github.com repo的ssh key的记录:

BruceChan@changjiang MINGW32 ~/.ssh
$ ssh-keygen -t rsa -C "<email address>"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/BruceChan/.ssh/id_rsa): id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
SHA256:nfT3BPsc06PGBRxV2dw0Ee6LpUBTkLSD9cWAZyF+N3w <email address>
The key's randomart image is:
+---[RSA 2048]----+
|          .=+==OX|
|          +o*o=o=|
|         ..*o=.=E|
|         o.o+ +o+|
|        S o.. oBo|
|            o.*==|
|             * .+|
|            .    |
|                 |
+----[SHA256]-----+

接下来需要将id_rsa.pub中的内容放到远程仓库里,一般都是在远程仓库的设置,ssh key设置里,完成后会在页面上以列表的形式出现。

最后检验:

BruceChan@changjiang MINGW32 ~/.ssh
$ ssh -T git@github.com
Enter passphrase for key '/c/Users/BruceChan/.ssh/id_rsa':
Hi changjiangChen-BruceChan! You've successfully authenticated, but GitHub does not provide shell access.

<注>--此处用git-hub_rsa的密钥时,该命令会出现 Permission denied,于是采用之前的id_rsa

  另外,由于在设置密钥rsa时,输入的密码,导致都要输入这个密码。如果输入密码时直接跳过,就可以不用输入。

转载于:https://www.cnblogs.com/bruceChan0018/p/5807461.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值