Gitee configures SSH private key access, SpringCloud configuration center Config (Git version)

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

insert image description here

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
insert image description here

1.3 Enter the following command to view the content of the public key

cat id_rsa.pub

insert image description here

1.4 Set public key

  1. Copy the content of the public key output in 1.3 (note: the content of the public key starts with ssh-rsa)
  2. Open gitee public key settings
    insert image description here
  3. Click OK to verify the password
    insert image description here
  4. Validation setup succeeded
ssh -T [email protected]

The following figure indicates success:
insert image description here

Guess you like

Origin blog.csdn.net/H1101370034/article/details/125691959