Home  >  Article  >  Development Tools  >  Can gitee only have one public key?

Can gitee only have one public key?

PHPz
PHPzOriginal
2023-04-26 09:21:471207browse

Gitee is an excellent domestic Git code hosting platform. It provides developers with many convenient functions, including code warehouse, code review, collaborative development, etc. When using Gitee for code management, it is often necessary to use SSH keys for authentication. When using SSH keys, many developers have a question: Can Gitee only have one public key?

SSH keys are a very secure and convenient way to authenticate by using a public and private key pair. On Gitee, we can add multiple public keys to facilitate code management on multiple computers or multiple development environments. However, for a Git repository, only a unique public key can be used for authentication.

On Gitee, we can add multiple SSH public keys through the following operations:

  1. Open the SSH key management page of the personal center.
  2. Click the "Add Key" button, then enter the name and public key of the SSH key in the pop-up dialog box, and then click the "OK" button.
  3. Repeat the above steps to add other SSH public keys.

After the addition is completed, we can use these public keys for authentication on multiple computers or multiple development environments. However, for a Git repository, only a unique public key can be used for authentication. Therefore, we need to add the corresponding public key to each Git repository.

On Gitee, we can add the SSH public key to the Git repository through the following operations:

  1. Open the Git repository to be managed.
  2. Click "Settings" - "SSH Public Key" option, and then click the "Add Public Key" button.
  3. Enter the name and public key of the SSH public key in the pop-up dialog box, and then click the "OK" button.

After the addition is completed, we can use the corresponding public key for authentication.

In addition to manually adding SSH public keys on Gitee, we can also manage SSH public keys through some automated methods. For example, you can use automation tools such as Ansible to automatically add SSH public keys to quickly manage code in multiple environments.

In short, Gitee does not only use one public key. We can add multiple SSH public keys, but for a Git warehouse, only a unique public key can be used for authentication. Therefore, when using Gitee for code management, we need to add the corresponding SSH public key to each Git repository to facilitate code management in different development environments.

The above is the detailed content of Can gitee only have one public 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