Create an SSH key to connect to GitHub or gitlab

Source: Internet
Author: User

Tag: git

When we clone a project from GitHub or gitlab or participate in a project, we need to prove our identity. One possible solution is to add the account name and password to each access, and save a unique key locally, you can also save this key in your account and include it when you access it. GitHub and gitlab use keys to verify your identity and use RSA Algorithms to generate this key. Link Method
  1. First, you need to have an account on GitHub or gitlab.
  2. Open git bash and enter the command LS-Al ~ /. Ssh. Check whether id_rsa.pub or id_dsa.pub exists. If yes, skip step 1.
  3. In git bash, type ssh-keygen-t rsa-c "[email protected]". Replace the email address with your own email address. After the following output is displayed, press Enter. Then it is displayed as follows: here we can see that the id_rsa and id_rsa.pub files have been generated. The generated path is also displayed.
  4. Open the id_rsa.pub file with notepad and copy all the content.
  5. Open the SSH key tag in your gitlab or GitHub account. Select the Add SSH key button, paste the copied content, and click Add key.

After all the operations are completed, as long as you have permissions for the project you want to operate on, you can perform git operations smoothly.


Create an SSH key to connect to GitHub or gitlab

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.