1. if ssh is not installed, run the following command:
Sudo apt-get install ssh
2. Check the SSH public key.
Cd ~ /. Ssh
Check whether the. ssh file exists. If the file exists, move to the next step. If the file does not exist, go to the next step.
3. generate an SSH Public Key
$ Ssh-keygen-t rsa-C "your_email@youremail.com" # Creates a new ssh key using the provided email Generating public/private rsa key pair. enter file in which to save the key (/home/you /. ssh/id_rsa ):
Now you can see that there is a. ssh directory under your own directory, which indicates that it is successful.
3.1 enter the github Password
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
Enter the password you set on github.
3.2 and you can see in. ssh
Your identification has been saved in/home/you /. ssh/id_rsa. # Your public key has been saved in/home/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@youremail.com
4. Add the SSH public key to github.
Open github, find the account, add SSH, and copy the idrsa. pub content to the key.
5. Test effectiveness
Use the following command to test
Ssh-T git@github.com
When you see the content in, direct yes
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 )?
When you see this content, it means it is successful.
Hi username! You 've successfully authenticated, but GitHub does not provide shell access.