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
- 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
- mkdir ~/.ssh
4, configure the global name and email, here is your GitHub or bitbucket name and email
[Java]View PlainCopy
- git config--global user.name "XKWG"
- git config--global user.email "[email protected]"
5. Generate key
[Java]View PlainCopy
- 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
- 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
- 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