How to manage multiple ssh keys within a ~/.ssh/folder on a single machine

Source: Internet
Author: User

Just touch GitHub, follow Liao's tutorial http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000

The first time you operate SSH key there, no problem.

However, the teacher's new project, not on the github.com, hanging on the coding.net, so on the coding.net also set up SSH key.

Thus, a series of problems arose, the essential reason is that coding.net read the original dedicated to GitHub ~/.ssh/id_rsa;

And what I need now, of course, is to let Coding.net read ~/.ssh/id_rsa_coding.

Naturally, if I clone the repository, it must fail:

git clone [email protected]:xxx/xxx.git

It would be glorious to get a pemission denied.

Specific practices:

I refer to the http://www.cnblogs.com/fanyong/p/3962455.html ....

However, there is one of the most harmful operations in this, which is

If you are prompted "Could not open a connection to your authentication agent" When you execute Ssh-add, you can now execute the command:

$ ssh-agent Bash

Then run the Ssh-add command again.

I am in this machine (including some other people I see some posts) to lose this command at all no, pit Dad no limit, about this command I also checked, in short, does not work.

My way of handling:

Skip this step directly, then create a new config file and populate the content by Http://www.cnblogs.com/fanyong/p/3962455.html Post sample

VI Config

Here is the contents of my config file (already successful)

#githubHost github.comhostname github.compreferredauthentications publickeyidentityfile ~/.ssh/id_rsa# Coding.nethost coding.nethostname coding.netpreferredauthentications publickeyidentityfile ~/.ssh/id_rsa_coding

Then, the final test:

[Email protected] ~/.ssh$ ssh-t [email protected]warning:permanently added the RSA host key for IP address ' 192.30.252.1 "To the list of known hosts. Hi ***! You've successfully authenticated, but GitHub does not provide shell access. [Email protected] ~/.ssh$ ssh-t [email protected]permission denied (publickey). [Email protected] ~/.ssh$ ssh-t [email protected]coding.net Tips: [Hello!] You ' ve connected to coding.net by SSH successfully! ]

  

How to manage multiple ssh keys within a ~/.ssh/folder 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.