Windows git ssh key for GitHub

Source: Internet
Author: User

First: check if SSH exists (Ls-al ~/.ssh)
$ ls-al ~/.sshLists the files in your. SSH directory, if they exist

Second: Generate a new SSH key (ssh-keygen-t rsa-c "[email protected]")

$ ssh-keygen-t rsa-c "[email protected]"creates a new SSH key, using the provided email as a labelGener ating public/private RSA key pair. Enter file in which to save the key (/c/users/you[press Enter]
[Type a passphrase]     [press ENTER]
[Type passphrase again]     [press ENTER]
The resulting results are as follows:
Your identification have been saved in/c/users/you/.ssh/id_rsa. Your Public key have 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 [email protected]

Add a new key to Ssh-agent:
$ ssh-agent-sAgent PID 59566$ ssh-add ~/.ssh/id_rsa 

If could not open a connection to your authentication agent appears
Workaround:
$ eval $ (ssh-agent)
Agent PID 59566
Ssh-add ~/.ssh/id_rsa
Identity added:/c/users//.ssh/id_rsa(/c/users/you/.ssh/id_rsa)
Third: Add SSH key to GitHub
$ clip < ~/.ssh/id_rsa.pubCopies the contents of the Id_rsa.pub file to your clipboard
As shown in the following:

IV: Check if no configuration is successful

In Git bash, enter:

$ ssh-t [email protected]attempts to ssh to GitHub

May appear:

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. Is you sure want to continue connecting (yes/no)? 

This is normal, enter Yes

username! You've successfully authenticated, but GitHub does notprovide shell access.
V: Change the git remote URL: convert https://github.com/xxxx.git to [email protected]:xxxx.git

That is, modify the. git/config file

Article excerpt from: Https://help.github.com/articles/generating-ssh-keys

Windows git ssh key for GitHub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.