Sep 252013
 

I don’t like to hawoman indicating ssh ve several of anything, because at the end I always get mixed up (yes, everyday I mixed all my different passwords, I never remember which one I have to use).
So having several ssh keys was not something that I wanted to have, but for X reason it just happened and I have to handle with it.

So thanks to Christophe, he told be how to configure my ssh file so that I could have manage several keys without pain 🙂

The thing is create on you home directory, under .ssh folder a config file

➜  ~  touch .ssh/config

Then you can edit the file and insert the following lines

 

Host heroku.com
IdentityFile ~/.ssh/my_public_key
IdentityFile ~/.ssh/my_second_public_key
IdentitiesOnly yes

Host github.com
IdentityFile ~/.ssh/my_public_key
IdentitiesOnly yes

As you can see, you need to specify for each server which key or keys you are using, so that when it tries to connect the server will just find out which one is the valid one 🙂

 Posted by at 1:38 am

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)