Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been using SSH alot. I find myself creating new keys when something fails, like for git, then I lose communication to my other servers. I know going forward there should only be one set of locally generated keys, but for now, I need to merge the many /.ssh backups I've made so they can all be used simultaneously. How can I do this?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

It is permissible to list many keys in your ~/.ssh/config. Or you can add many keys to an SSH agent.

Host *
    IdentityFile ~/.ssh/zoredache_20101108.id_rsa
    IdentityFile ~/.ssh/zoredache_20100211.id_rsa
    IdentityFile ~/.ssh/zoredache_20080514_id_rsa
share|improve this answer
add comment

In your ~/.ssh/config file try:

Host A
    IdentityFIle ~/.ssh/for-host-a.id

Host B
    IdentityFIle ~/.ssh/for-host-b.id

Host C
    IdentityFIle ~/.ssh/for-host-c.id

A session setup only allows 3 authentication attemps before the connection is dropped. Think of that as a 3 ID file limit. With the above, you can ssh to host A and it will use just that ID file. ssh to host B and it uses a different one, and so on.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.