How to generate ssh key under Windows system and how to add public key in Code Cloud

foreword

This article takes the window system and code cloud as examples to explain how to generate an ssh key under the window system, then add the public key to the code cloud, and then clone the remote git warehouse code with the ssh address of the remote warehouse

1. First generate the ssh key under the window:

1. First, we need to install git on our computer. After installing git, click the right mouse button on the desktop to open git bush:
insert image description here
2. After opening the git bush command window, enter: ssh-keygen -t rsa -C “123@email .com", the quotation marks are your registered email address on Code Cloud, then press the Enter key, follow the prompts, enter information step by step, and press the Enter key to skip all of them, as shown in the figure below:

insert image description here
3. Output the information as shown in the figure above, which means that the ssh key has been successfully generated, and then enter eval "ssh-agent -s", as shown in the figure:
insert image description here
4. Then enter ssh-agent bash, and then enter ssh-add ~/. ssh/id_rsa is fine, as shown in the figure:
insert image description here

2. Add the generated ssh key to Code Cloud:

1. Still enter vim ~/.ssh/id_rsa.pub in the git bush command window just opened and press Enter, and then copy all the content:
insert image description here
2. Add the public key in the code cloud, as shown in the figure:
insert image description here
3. In this way, the addition is successful , below we can clone the code of the remote warehouse through the ssh address of the remote warehouse:
insert image description here

Guess you like

Origin blog.csdn.net/m0_37873510/article/details/126494096