Home  >  Article  >  Development Tools  >  What is Gitee's SSH Key?

What is Gitee's SSH Key?

PHPz
PHPzOriginal
2023-03-30 16:14:051405browse

Gitee is a source code hosting platform that allows developers to easily manage and collaborate on code. To keep your code secure, Gitee uses SSH keys for authentication and encryption to prevent unauthorized users from accessing your code.

SSH (Secure Shell) is an encryption protocol. Through the SSH protocol, you can safely log in to a remote server or manage code in an unsecured network environment. SSH Key is a key pair used for the SSH protocol, which contains two parts: a public key and a private key.

A public key is a string of numbers and letters used to verify your identity. A private key is an encrypted file used to decrypt your messages. The corresponding decrypted message can only be obtained using the matching key.

Gitee uses SSH Key for authentication because it is very secure. SSH Key uses public key encryption technology, which is more secure than traditional usernames and passwords. Because the SSH Key is personal to you, no one can copy your authentication information from your machine. Unless someone can crack your private key, no one can obtain your authentication information from the outside.

How to create SSH Key?

First, you need to create a pair of SSH Keys on your local computer. Open the terminal and enter the following code:

ssh-keygen

Next, you will be prompted to enter the file name and password. This password is used to protect your private key. You can leave the file name as default and set a password. Please note: Passwords should be strong enough and not easily guessed.

Next, the system will generate two files for you: id_rsa and id_rsa.pub. id_rsa is your private key and cannot be shared with anyone. id_rsa.pub is your public key, you need to add it to Gitee.

How to add SSH Key to Gitee?

  1. Add a new SSH Key in Gitee. Log in to your Gitee account, click your avatar, select Settings > SSH Public Keys, then click Create New SSH Public Key.
  2. Add SSH Key to the page. In the "Key" field, copy the contents of id_rsa.pub and paste it into the input box.
  3. Click "Confirm" and the SSH Key will be added to your Gitee account.

Next, when you clone or commit code, you need to use the SSH protocol and authenticate with your private key.

Summary

SSH Key is a secure method for Gitee authentication, which is more secure than traditional usernames and passwords. Creating an SSH Key and adding it to Gitee requires a few steps, but it keeps your code secure and your personal information protected.

The above is the detailed content of What is Gitee's SSH Key?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is gitee in Chinese?Next article:What is gitee in Chinese?