github with msysgit:配置SSH Key
Step 1: Check for SSH keys
First, we need to check for existing ssh keys on your computer. Open up Git Bash and run:
cd ~/.ssh
ls
# Lists the files in your .ssh directory
Check the directory listing to see if you have a file named either id_rsa.pub or id_dsa.pub. If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.
Step 2: Generate a new SSH key
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]
ssh-add id_rsa
Now you need to enter a passphrase.
# Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]
Which should give you something like this:
# Your identification has been saved in /c/Users/you/.ssh/id_rsa.
# Your public key has been saved in /c/Users/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@example.com
Step 3: Add your SSH key to GitHub
Run the following code to copy the key to your clipboard.
clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard
Go to your Account Settings
Click "SSH Keys" in the left sidebar
Click "Add SSH key"
Paste your key into the "Key" field
Click "Add key"- Confirm the action by entering your GitHub password
Step 4: Test everything out
To make sure everything is working you'll now SSH to GitHub. When you do this, you will be asked to authenticate this action using your password, which for this purpose is the passphrase you created earlier. Don't change the git@github.com part. That's supposed to be there.
ssh -T git@github.com
# Attempts to ssh to github
You may see this warning:
# 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)?
Don't worry, this is supposed to happen. Verify that the fingerprint matches the one here and type "yes".
# Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.
If that username is correct, you've successfully set up your SSH key. Don't worry about the shell access thing, you don't want that anyway.
If you see "access denied" please consider using HTTPS instead of SSH. If you need SSH start atthese instructions for diagnosing the issue.
github with msysgit:配置SSH Key的更多相关文章
- window下配置SSH连接GitHub、GitHub配置ssh key(转)
转自:http://jingyan.baidu.com/article/a65957f4e91ccf24e77f9b11.html 此经验分两部分: 第一部分介绍:在windows下通过msysGit ...
- window下配置SSH连接GitHub、GitHub配置ssh key
window下配置SSH连接GitHub.GitHub配置ssh key 此经验分两部分: 第一部分介绍:在windows下通过msysGit(Git for windows.Git Bash)配 ...
- 解决GitHub未配置SSH key提示错误信息
git push -u origin master Permission denied (publickey). fatal: Could not read from remote repositor ...
- 【Linux】配置SSH Key到GitHub/GitLab
Linux配置SSH Key到GitHub/GitLab 准备工作 首先检查下本机是否已经安装了SSH,在终端输入ssh即可: 如果没有安装进行yum安装 # yum -y install opens ...
- SSH连接GitHub并配置ssh key
SSH连接GitHub并配置ssh key 配置git的ssh提交,主要需要以下三步: 1.设置Git的user name和email 2.生成ssh 3.配置git 的ssh key 一.设置Git ...
- git配置SSH Key,上传本地代码至github
git配置全局的name和email git config --global user.name "name" git config --global user.email &qu ...
- git配置ssh key并从github.com拉取repos
一.配置ssh key 1. 进入当前用户目录cd ~2. 生成ssh keyssh-keygen -t rsa -C "ABC@qq.com"ABC@qq.com账号必须是你登录 ...
- GitHub如何配置SSH Key
https://github.com/xiangshuo1992/preload.git git@github.com:xiangshuo1992/preload.git 这两个地址展示的是同一个项目 ...
- 多个github帐号的SSH key切换
写在前面的话 github账号,工作有一个,自己有一个.但是默认下使用ssh key在git push时只有默认账号能免输入账号和密码. 如果想让另一个账号在代码push时免账号和密码,请看这篇文章h ...
随机推荐
- Doctype作用?严格模式与混杂模式如何区分?它们有何意义?
怪异模式和严格模式(译注:一般称为标准模式:Standards Mode,下文中的严格模式都可以理解为标准模式)是浏览器解析CSS时的两种‘模式’.这篇文章将简单阐述这两种模式之间的差异. 译注:一个 ...
- 将HTML5封装成android应用APK文件的几种方法
越来越多的开发者热衷于使用html5+JavaScript开发移动Web App.不过,HTML5 Web APP的出现能否在未来取代移动应用,就目前来说,还是个未知数.一方面,用户在使用习惯上,不喜 ...
- 【WPF】新复制wpf项目报错
错误提示:Program does not contain a static 'Main' method suitable for an entry point 1.App.xaml 文件属性:生成操 ...
- java 分页功能
1.分页工具类 package com.bw.shop.util; import java.util.List; import com.sun.org.apache.regexp.internal.r ...
- pImpl
之前看代码,一直对pIml这个用法一知半解,参考这里 的一篇文章后有所收获. 总结一下,pIml的好处如下: 第一,引入更多的头文件降低编译速度.而且这个声明当然写在一个头文件里,而头文件,是不能预编 ...
- Spring和Mybatis整合,配置文件
整合时除了未整合前spring.mybatis的必须包外还需要加入两个包 spring-jdbc-4.2.5.RELEASE.jar mybatis-spring-1.2.5.jar spring-j ...
- Android基础总结(八)
服务两种启动方式(掌握) startService 开始服务,会使进程变成为服务进程 启动服务的activity和服务不再有一毛钱关系 bindService 绑定服务不会使进程变成服务进程 绑定服务 ...
- phpcms二次开发中无法获取SESSION的值
今天在在phpcms开发留言板用到验证码,提交数据,后台无法$_SESSION['code']无法获取验证码值,也无法打印var_dump($_SESSION)值,我们只需要在文件头部添加如下代码: ...
- iOS持续写文件到本地
NSString *tempSavePath = [NSString stringWithFormat:@"%@/Documents",kDocumentPath]; NSFile ...
- Zabbix Trapper items
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px STHeiti; color: #313131 } span.s1 { } 概述 Trappe ...