Use GitHub (a): Add SSHkey
- This paper briefly describes the use GitHub code version control, including adding SSHKEY , configure Git , using Git repository is created and managed on GitHub, the main purpose is to summarize and learning content for future reference.
- Principles and detailed tutorial can refer Liao Xuefeng of Git tutorial or monkeys can understand the Git tutorial .
- This article belongs Ma Taotao all.
- Cited herein pictures and text belongs to original author, tort deleted.
- If wrong, please point out in the comments area below, welcomed the positive discussions.
Add SSHkey
- Simply put, SSH is a network protocol used between computers encrypted login .
- If a user from the local computer, use SSH to log into another computer remotely agreement, we can believe that this login is safe , even being intercepted, the password will not leak.
- The first time, Internet communication is expressly communications, intercepted once, on the content exposed. In 1995, Finnish researchers TatuYlonen designed the SSH protocol, the login information of all encryption , Internet security has become a fundamental solution to solve, rapidly gaining promotion in the world, has now become the standard configuration of Linux systems.
- Here you only need to add SSHkey need to know before you use GitHub, GitHub used to verify the remote repository you can, if you want to understand the principles, reference Ruan Yifeng SSH principle .
step:
- Enter https://github.com/settings/keys
- If the page already has some key, on the point of "delete" button to delete the whole key. If not, look down
-
Click New SSH key, you need to enter the Title and Key, but you do not have key, look down
To add a reference here
- Open Git Bash
- Copy and run
rm -rf ~/.ssh/*
the existing ssh key are deleted, the phrase command line if you play more than one space, it may be necessary to reinstall the system, it is recommended to copy run. - Run
ssh-keygen -t rsa -b 4096 -C "你的邮箱"
, pay attention to fill in your real mailbox. - Press Enter three times
Reference Example: In this case .ssh generates a hidden file in the directory ~
- Run
cat ~/.ssh/id_rsa.pub
, get a bunch of things, a complete copy of this string thing - Back to the page in step 3 above, enter "My first key" in the Title
- You just paste the string of things that you copied in Key Lane
- Click the Add SSH key
- Back to the Git Bash
- Run
ssh -T [email protected]
, you may see this prompt:
- Enter
yes
Enter - Then see if you
Permission denied (publickey).
show that you failed, please go back to step 1 again, yes, return to step 1 again; if you seeHi FrankFang! You've successfully authenticated, but GitHub does not provide shell access.
It shows you a success!
- Well, add a SSH key, it will be used next.
- A computer requires only a SSH key
- A SSH key can access all your warehouse, even if you have 1 million warehouse, no problem
- If you bought a new computer, regenerate it on a new computer a SSH key, this key can also be uploaded to GitHub, and before it can co-exist on the key GitHub
- If you delete a key from your computer, you can regenerate a key, replacing the previous key