Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.

On this page

Show all

Help Center/ CodeArts Repo/ FAQs/ Troubleshooting/ Private Key Is Lost

Private Key Is Lost

Updated on 2023-12-04 GMT+08:00

Symptom

git clone fails because the private key is incorrect or is lost. When the key authentication fails, the system switches to password-based authentication. Since no password is configured previously, the password authentication fails, either, as shown in Figure 1.

Figure 1 Authentication failure due to private key loss

Solution

  1. Log in to the CodeArts Repo service repository list page, click the alias in the upper right corner, and choose This Account Settings > SSH Keys. The page is displayed.

  2. On the SSH Keys page displayed, click to delete the existing key.
  1. Generate a new key pair.

    Run ssh-keygen -t rsa -C "abc123@***.com" to generate a key pair.

  2. Copy the generated public key and run cat ~/.ssh/id_rsa.pub.
    Figure 2 Copying a public key
  3. On the SSH Keys page, click Add SSH Key. As shown below.

  4. On the CodeArts Repo homepage, click SSH in the Repository URL column of the repository to be cloned.

  5. Clone the code.
    Run git clone SSH URL.
    Figure 3 Cloning code
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback