Configuring an SSH Key
Introduction
An SSH key securely connects a local computer with your CodeArts Repo. For details, see Procedure.
You can configure an SSH key by referring to Procedure or Configuring an SSH Key.
Constraints
If you have more than one computer, you need to configure an SSH key for each so that all accounts on the computer can be connected through the SSH key.
Procedure
You can configure an SSH key by referring to Configuring an SSH Key or the following steps.
- Run Git Bash to check whether an SSH key has been generated locally. Run the following command in Git Bash:
cat ~/.ssh/id_rsa.pub
- Generate an SSH key. Run the following command to generate a key in Git Bash:
ssh-keygen -t rsa -b 4096 -C your_email@example.com
- -t rsa indicates that an RSA key is generated.
- -b 4096 indicates the key length. (RSA keys of this length are more secure.)
- -C your_email@example.com indicates that a comment is added to the generated public key file to help identify the purpose of the key pair.
Enter the command for generating a key and press Enter. The key is stored in ~/.ssh/id_rsa by default, and the corresponding public key file is ~/.ssh/id_rsa.pub.
- Copy the SSH public key to the clipboard. Run the corresponding command based on your operating system.
- Windows:
clip < ~/.ssh/id_rsa.pub
- Mac:
pbcopy < ~/.ssh/id_rsa.pub
- Linux (xclip required):
xclip -sel clip < ~/.ssh/id_rsa.pub
- Windows:
- Log in to Repo and go to the code repository list page. Click the alias in the upper right corner and choose This Account Settings > Repo > SSH Keys. The SSH Keys page is displayed.
You can also click Set SSH Keys in the upper right corner of the code repository list page. The SSH Keys page is displayed.
- In Key Name, enter a name for your new key. Paste the SSH public key copied in 3 to Key and click OK. The message "The key has been set successfully. Click Return immediately, automatically jump after 3s without operation" is displayed, indicating that the key is set successfully.
Related Document
- If Failed to add the key. Check whether the key is valid. is displayed, the entered key is invalid. If the key is manually copied from the local host, redundant spaces may have been copied or the copied key is incomplete. In this case, reconfigure the key by referring to 3.
- When you configure an SSH key, the following message is displayed: SSH Key Already Exists, indicating that the key has been added to the account or another account. Solution: Generate a new SSH key locally by referring to the preceding steps and configure the generated key in CodeArts Repo.
- CodeArts Repo provides an API to obtain the SSH key list. For details, see Obtaining the SSH Key List.
- CodeArts Repo provides an API to obtain the SSH key list. For details, see Adding an SSH Key.
- CodeArts Repo provides an API to obtain the SSH key list. For details, see Adding an SSH Key.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot