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 a debian server with some git repositories. I've generated two keys using

keygen -t rsa

That gave me root.pub and user.pub files. The root.pub was appended to /root/.ssh/authorized_keys and user.pub to /home/user/.ssh/authorized_keys.

I've converted keys to putty format (ppk): root.ppk and user.ppk. Now I am able to login as both root and user with these keys using putty - everything works fine!

The magic comes when it is about TortoiseGit (the latest release). I've set two remotes:

[remote "user"]
    fetch = ...
    url = ssh://user@server/path
    puttykeyfile = C:\\path\\user.ppk
[remote "root"]
    fetch = ...
    url = ssh://root@server/path
    puttykeyfile = C:\\path\\root.ppk

With root.ppk everything works fine - I can push and pull to my repositories without entering the password. But user.ppk is failing - I get TortoisePLink window with password prompt.

There is nothing in /var/log/auth.log. I am completely stuck. Does TortoiseGit (or Windows) require some more configuration?

UPDATE: Seems TortoiseGit caches or stores the key somewhere. If I add root.pub to /home/user/.ssh/authorized_keys I can push/pull using both remotes no matter which key I specify in TortoiseGit settings. Killing TortoiseCache.exe, restarting pageant, rebooting windows machine has no effect.

It definetely stores the key somewhere. The ssh login uses root.ppk only no matter what I configure. So the question is "Where does TortoiseGit store ppk keys other than in .git/config"?

share|improve this question

2 Answers 2

Did you actually mean this:

The root.pub was appended to /root/.ssh/authorized_keys and user.pub to /home/user/authorized_keys.

Because that shows that you put the user.pub in the wrong file - it syould be

/home/user/.ssh/authorized_keys
share|improve this answer
    
Sure, changed the question. Thanks for pointing out. –  ike3 Jul 20 '12 at 7:16
    
Can you use putty directly SSH to the server using that key? –  Jenny D Jul 20 '12 at 8:25
    
Yes I can. Both keys works fine in putty. The problem is only in TortoiseGit –  ike3 Jul 20 '12 at 8:56
up vote 0 down vote accepted

J just have done absolutely the same on my other Windows machine. Everything works fine. I noticed that ssh-keygen command was from MSysGit distribution while on the first machine I tried Cygwin one.

share|improve this answer

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.