How to configure multiple git RSA on a single machine

Source: Internet
Author: User
How to configure multiple git RSA issues on a single machine

Many times, we use multiple git libraries on a single machine, such as GitHub, CSDN, and our own company. Then RSA is going to have multiple copies. So how do we make these things work together?
The principle is: Build multiple different RSA and then separate configuration in SSH config.

Step 1: Establish RSA
ssh-keygen -t rsa -C "你的邮箱地址"

After executing this command, the following prompt pops up:

Enter file in which to save the key (/Users/aaaa/.ssh/id_rsa):

Here is where "build multiple different RSA" files, enter a different name, will produce different RSA. For example, enter: Csdn_rsa. The Csdn_rsa is produced.

Repeat the above command, then build the Git hub.

2 modifying SSH config

Now, both the csdn and the Git hub have their own RSA. So, how to guide the selection of different RSA authentication. The SSH config file needs to be modified.
If your ~/.ssh directory does not have please create a file like this, file name: CONFIG.
The following thing is to modify the config file. Modify as follows.

Host github.comUser 你的名字IdentityFile ~/.ssh/id_rsaHost code.csdn.netUser 你的名字IdentityFile ~/.ssh/csdn_rsa

This makes it enjoyable to use multiple RSA.

How to configure multiple git RSA on a single machine

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.