Mac system git generates SSH public key

Source: Internet
Author: User
Tags using git

Mac system git generates SSH public key

When using Git repository for code management, the new computer often needs to generate SSH public key to match, Mac system generated git public key process is as follows:

1. Check if the machine has a public key

Enter the following command in the terminal:

?
1 cd~/.ssh

2. If the computer has a previously left key, delete it

Use the following command:

?
123 mkdirkey_backupcp id_rsa* key_backuprmid_rsa*

3. Generate a new public key

Enter the following command in the terminal

?
1 ssh-keygen -t rsa -C "邮箱地址"

After the terminal will be prompted several times the password settings, if the password is set, in the Git repository for code interaction with the need to type a password, you can also return all the time, indicating that no password is required.

4. Import the public key into the Git repository

Using the LS command under the. SSH folder to view all the files, you can see that a id_rsa.pub file is generated, open it with the VI tool, copy its contents, create a new public key in the Git repository, and copy it up. For example, the import key process in GitHub is as follows:

Transferred from: http://my.oschina.net/u/2340880/blog/658594

Mac system git generates SSH public key

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.