This is my second article about getting started

Preface:

What is an SSH key

•SSH key is an encrypted network transport protocol that establishes a secure connection between your computer and the code hosting service under your account.

• After an SSH key is configured on a computer and the public key is added to the code hosting service, all code repositories under that account can be connected to that computer using the key.

• Different users usually use different computers. Before using SSH to connect to the code repository, they need to generate their own SSH keys on their own computers and set them in the remote repository.

1. Set local GIT parameters to generate SSH keys

• Run a command on the local Git client to try to display the SSH key.

cat ~/.ssh/id_rsa.pub 

Copy the code

• Run Git Bash and enter the following command line to configure the user name and mailbox

Git config --global user.email git config --global user.emailCopy the code

• Generate a pair of SSH keys. The generated key is usually saved in ~/.ssh/id_rsa.pub

Ssh-keygen -t rsa -c "< your email >"Copy the code

• Display key content

cat ~/.ssh/id_rsa.pub 

Copy the code

Second, the creation of Huawei Cloud DevCloud warehouse

• Create a project

• Create code repositories.

A. Go to the created project and choose Code > Code Hosting.

B. Select Create, create, or Import an external warehouse as required, enter the warehouse name as prompted, and click OK.

C. After the code repository is created successfully, the page is automatically displayed to view the files in the repository.

3. Configure the SSH key for the DevCloud repository

• Click the user name in the upper right corner of the page and select Personal Settings from the drop-down list.

• Choose Code Management > SSH Key Management from the navigation tree.

• Click Add SSH Key, enter the title, enter the key generated in installing and configuring the Git client, and click OK.

4. Test SSH links

• Test the connection code

ssh -vT [email protected] 

Copy the code

• if return content contains “connect to host codehub.devcloud.huaweicloud.com port 22: Connection timed out “, as shown in the following figure, then your network is restricted and you cannot access the code hosting service. Please contact your local network administrator for help.