1

Possible Duplicate:
How to work with 2 ssh keys

I searched how to use Git+Github on one machine and 2 users. I'm running Win7 and a portable version of Git.

Let's say that I (kursion) want to "push" my project to my repository called kursion, and my second user (kursion2) wants to "push" his project to his repository called kursion2 (on the same machine).

What I have done already is clone both projects to gitKursion and gitKursion2 folders. Generate the key RSA key for kursion with:

> ssh-keygen -t rsa -C "kursion@you_won't_know_this.com"

First: i wasn't able to change the directory to something like => /d/documents/ssh-keys, got "Failed", "File exists" error :( Second, I am not able to change the user who push the project. I can do

> git push git@github.com:kursion/myProject #(works because i'm kursion and the RSA key is correct for this user)

But i can't do this:

>git push git@github.com:kursion/myProject #(because i'm not kursion2 and the RSA key is the one from "kursion")

How to do this in a clear and simple manner?

Will appreciate any help and hope that I am not spamming duplicate question :)

Community
  • 1
  • 1
Yves Lange
  • 3,914
  • 3
  • 21
  • 33

2 Answers2

2

Normally one user should have his own home directory with a single identity file (a private key). If you cannot do it, you could have several files. Please read for more details here: http://www.kelvinwong.ca/2011/03/30/multiple-ssh-private-keys-identityfile/

kan
  • 28,279
  • 7
  • 71
  • 101
0

Why don't you just generate two ssh keys - one for kursion and another for kursion2? And add the public part of the keys to github.

idlethread
  • 1,111
  • 7
  • 16
  • First: ty for your reply. Actually i'm trying to create the second ssh-key. And i was asking myself: "wow ok assuming that i have the second key, how can i use it for a different user". But ssh-keygen don't let me choose the folder in which i want to save the keys ("Failed, file exists"... but the folder that i choose is ... empty [/d/documents/ssh-keys]). – Yves Lange Jan 27 '12 at 14:21
  • You mean 'ssh-keygen -f foobar' doesn't create keys names foobar and foobar.pub on windows? – idlethread Jan 27 '12 at 23:03
  • it does. But after when i try to specify the folder in which i want to save both files, this will not work correctly. (I have a portable version of Git, this is maybe the reason why it doesn't work gr8) – Yves Lange Jan 28 '12 at 02:39