git:windows git ssh keys generation

Source: Internet
Author: User

http://blog.csdn.net/lsyz0021/article/details/52064829


When we use a warehouse such as GitHub or bitbucket, we may need SSH authentication, so we need to generate his SSH key.


1, first you want to install the Git tool

: Https://git-scm.com/downloads


2, right mouse, check "Git Bash here", of course you can also in Windows "Start"---> "so Program", or install directory to open it



3, enter the command, enter the. SSH folder

[Java]View PlainCopy
    1. CD ~/.ssh/



If you are prompted with "No such file or directory", you can create a. ssh folder manually.

The command is:

[Java]View PlainCopy
    1. mkdir ~/.ssh

4, configure the global name and email, here is your GitHub or bitbucket name and email

[Java]View PlainCopy
    1. git config--global user.name "XKWG"
    2. git config--global user.email "[email protected]"


5. Generate key

[Java]View PlainCopy
    1. Ssh-keygen-t rsa-c "XKWG@163.com"


Press Enter three times in succession, the password set here is empty, and the key is created.

Your identification has been saved In/user/admin/.ssh/id_rsa.
Your public key has been saved in/user/admin/.ssh/id_rsa.pub.
The key fingerprint is:
..................


Finally, two files were obtained: Id_rsa and Id_rsa.pub


6. Open the Admin directory to enter the. SSH folder, open id_rsa.pub with Notepad, and copy the contents to your GitHub or bitbucket ssh settings.






This is the BitBucket add key, click on the top right of the avatar, select Settings, and then




This is GitHub add key




7, test whether to add success


BitBucket input Command:

[Java]View PlainCopy
    1. Ssh-t git@bitbucket. org

Tip: "You can use Git or HG-to-connect to BitBucket." Shell access is disabled. "description added successfully


GitHub input Command:

[Java]View PlainCopy
    1. SSH git@github. com

Tip: "Hi lsyz0021! You've successfully authenticated, but GitHub does not provide shel L access. " Description added successfully.


git:windows git ssh keys generation

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.