1. Create a public key
1.1 Open the command window of the local Terminal or git
Go to the following directory
cd ~/.ssh
If not, create one and open it again after creating
mkdir ~/.ssh
1.2 Enter the following command to generate a key pair
Change the mailbox to your git (gitee) login mailbox
ssh-keygen -t rsa -C "邮箱"
After entering the above command, press Enter all the way, you can also specify the path to save the file
1.3 Enter the following command to view the content of the public key
cat id_rsa.pub
1.4 Set public key
- Copy the content of the public key output in 1.3 (note: the content of the public key starts with ssh-rsa)
- Open gitee public key settings
- Click OK to verify the password
- Validation setup succeeded
ssh -T [email protected]
The following figure indicates success: