Monday 3 November 2008

unfuddle

I use unfuddle as a git host and bug tracking, etc service. But, because I have so many projects on the go I ran into this problem where you can only have an ssh key in ONE account on unfuddle. So, I wrote to the support guys and asked them how to handle multiple accounts from one machine.
Here is their response:

The easiest way to deal with need multiple keys for multiple accounts is to actually just create them using different filenames in your ~/.ssh/ directory. For instance, if you have 2 accounts, "account1" and "account2", you would want to run "ssh-keygen -t rsa" twice, each time specifying a different filename:

~/.ssh/unfuddle_account1_id_rsa
~/.ssh/unfuddle_account2_id_rsa

Now, by default, ssh will use the file ~/.ssh/id_rsa when connecting to a remote server. As neither of your keys is in this file, you must tell SSH (not git) which private keyfile to use when connecting to each account. This is done using the SSH config file.

For instance, create or edit a file named .ssh/config with the following contents:


Host account1.unfuddle.com
User git
IdentityFile ~/.ssh/unfuddle_account1_id_rsa

Host account2.unfuddle.com
User git
IdentityFile ~/.ssh/unfuddle_account2_id_rsa


I have followed this model for my own accounts (of which I have many) and it has worked perfectly. I hope this helps you as well.

No comments: