Re: [git-users] How tell git-bush which new private key to use
Hi, Do you have to keep the test key or you just want to *replace* it with the production key? I want replace the test key to production key. If replacement is needed, then just overwrite the id_rsa and id_rsa.pub files in your %HOME%\.ssh folder with the new ones (they might also be named id_dsa[.pub], and the .pub file (the public part of the key) You mean, I can the new key only copt in folder g:/.ssh/ A point to note is still, the name of my nek key ist mykey_130903.pub and mykey-privatekey_130903.ppk is this important? Sorry, I forgot to write that I'm using TortoiseGIT. How exactly did it not work out? I can work with TortoiseGIT with the new key, key form 03.09.2013. ssh -T -vvv user@host git --version sh.exe: c:xampphtdocsworkspace_aptanarepositorisbmykey_130911.ppk: command not found Here is first error, my key, that I use ist mykey_130903.ppk not mykey_130911.ppk eval $(ssh-agent -s) Agent pid 9528 ssh-add mykey_130903.ppk after this I make pull git pull and get following message: fatal: Not a git repository (or any of the parent directories): .git -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] How tell git-bush which new private key to use
On Thu, 12 Sep 2013 05:47:07 -0700 (PDT) berd bersc...@googlemail.com wrote: Do you have to keep the test key or you just want to *replace* it with the production key? I want replace the test key to production key. Okay. Next time please write your intent clearly -- that would have saved me from typing 60% of my first answer :-) If replacement is needed, then just overwrite the id_rsa and id_rsa.pub files in your %HOME%\.ssh folder with the new ones (they might also be named id_dsa[.pub], and the .pub file (the public part of the key) You mean, I can the new key only copt in folder g:/.ssh/ As it turns out based on the new information from you, not quite. I'll explain why in a moment. A point to note is still, the name of my nek key ist mykey_130903.pub and mykey-privatekey_130903.ppk is this important? That's good you mentioned this (again, note that the more information you tell the better for everyone). The extension .ppk suggests this is the key generated by PuTTY's key generation tool (puttygen.exe) *in its own container format,* not compatible with the OpenSSH client distributed as part of Git for Windows. A corollary to this is that there's no sense in putting those keys into %HOME%/.ssh -- the OpenSSH client can't make use of them anyway. That mykey_130903.pub had most probably been extracted from the .ppk key (using that same puttygen.exe tool) and given to you so you could make your private key trusted on the remote system (that thing is beyond the scope of our present discussion though). Can you verify your .ppk key is generated by PuTTY? Open it in a text editor and look at the first line -- does it read something like PuTTY-User-Key-File-2: ssh-rsa or -BEGIN RSA PRIVATE KEY- Which one? The first means it's a PuTTY-compatible form, the second means it's an OpenSSH-compatible form. If the key would turn out to be of the *second* form, just copy it under %HOME%\.ssh and name it id_rsa -- possibly replacing whatever key is already there under that name. Now remove all the Host-entry hacks you might have in your %HOME%\.ssh\config file. If, instead, the key turn out to be PuTTY's, you have two options: * Get PuTTY and convert your .ppk key file into an OpenSSH-compatible format using puttygen.exe. You run puttygen, click the Load button in its interface, enter the key's passphrase to decrypt the key then engage the Conversions - Export OpenSSH key main menu entry; when asked for a file to save, navigate to your %HOME%\.ssh folder and choose id_rsa as the name of the file. * Work with PuTTY as I described in my previous mail and just use this .ppk key file. To do this, you first set up Git to use PuTTY's plink.exe as its SSH client (via setting the GIT_SSH environment variable), then start pageant.exe (the key agent), activate the context menu on its tray icon, choose the Add key entry then select your .ppk key in the dialog, and enter the key's passphrase when asked. Sorry, I forgot to write that I'm using TortoiseGIT. TortoiseGit relies on calling stock Git binary and so respects the GIT_SSH setup already explained. You can also just use plain Git along with this front-end. ssh -T -vvv user@host git --version sh.exe: c:xampphtdocsworkspace_aptanarepositorisbmykey_130911.ppk: command not found Something awry with the formatting. And I have no idea why the key file is mentioned -- as I've say, if .ppk is not just a brain-dead extension and key is PuTTY's, stock SSH client won't work with it. Here is first error, my key, that I use ist mykey_130903.ppk not mykey_130911.ppk That's not the problem, I reckon. eval $(ssh-agent -s) Agent pid 9528 ssh-add mykey_130903.ppk That's strange! It *might* turn out that just the person who handed you this key is idiot, and the key is in OpenSSH format indeed. Anyway, I gave you enought information to deal with either case. after this I make pull git pull and get following message: fatal: Not a git repository (or any of the parent directories): .git As you should have guessed by yourself, this error has nothing to do with keys and SSH: it simply tells you you're currently not in a directly which Git is able to identify as the work tree of a Git repository. Change the directory to a real repository and retry. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] How tell git-bush which new private key to use
Hi, we use git gui with git bash, version: git-gui version 0.17.GITGUI git- version 1.8.3.msysgit0 on Win7 64-bit Now to testing we created new ssh key, but to working, we use other ssh key. For me is the question, how can I tell git-bash to take the new ssh key? Additional. My git-bash has his home folder in the network order: g:\.ssh but my working folder is c:/xampp/htdocs/workspace_aptana/repositoris/mygit1/git1-static I have found follow link: http://serverfault.com/questions/194567/how-to-i-tell-git-for-windows-where-to-find-my-private-rsa-key and from a friend: http://superuser.com/questions/232373/tell-git-which-private-key-to-use but both do not work quite. Does anyone have an idea? Thanks in advance. Regards berd -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] How tell git-bush which new private key to use
On Wed, 11 Sep 2013 05:03:27 -0700 (PDT) berd bersc...@googlemail.com wrote: [...] Now to testing we created new ssh key, but to working, we use other ssh key. For me is the question, how can I tell git-bash to take the new ssh key? [...] Do you have to keep the test key or you just want to *replace* it with the production key? If replacement is needed, then just overwrite the id_rsa and id_rsa.pub files in your %HOME%\.ssh folder with the new ones (they might also be named id_dsa[.pub], and the .pub file (the public part of the key) is not strictly needed -- it can always be regenerated from the private key, and it does not participarte in authentication). If you want to have both keys, continue reading. http://superuser.com/questions/232373/tell-git-which-private-key-to-use but both do not work quite. [...] The solution at the quoted link is the correct one for your case. How exactly did it not work out? Did you try to log in via plain SSH client and not make Git call it for you? -- this is the first thing to try when debugging. Open Git bash and run something like ssh -T user@host git --version there and see if it a) succeeds, and b) prints of the version of Git running on the remote system. If it fails to log in, try to pass one or more -v options to ssh -- the more you pass the more chattier it becomes, -- so try ssh -T -vvv user@host git --version Does this printout mention SSH reading the correct key file? Does it tell anything about failure to locate or read or parse it? Yet another approach to the problem is to switch to using the so-called SSH key agent -- this is a program which sits in memory permanently, and maintains decrypted private keys, which you submit to it exactly once, and when an SSH client tries to authenticate to the server using a private key it first tries to find and contact the key agent, and if it succeeds, asks the agent for the keys it has, and tries to use them. Stock Git for Windows includes a port of OpenSSH client, and so it includes the ssh-agent.exe binary. You can use it like this: 1) Start Git bash. 2) Run eval $(ssh-agent -s) which would a) place the agent into memory, and b) equip *this session* of Git bash with the necessary knowledge about how to reach the agent. 3) Run ssh-add /path/to/your/private/key/file several times for each of your keys, entering the passphrase for each. 4) Next time you run ssh it will try to contact the agent and get keys from it. 5) Before closing Git bash, run kill $SSH_AGENT_PID to shut down the running agent. If you won't do this and will just close the Git bash, the agent will remain in memory, and the next Git bash shell *won't* reuse it. On the other hand, having it in memory won't hurt other than occupying it -- you could kill it any time using Task Manager. You might customize this sort of setup by tweaking various per-user bash configuration files -- it could achieve running the agent at opening Git bash and killing it when Git bash closes. Personally, I don't have a ready to offer knowledge of how to do this, but it's doable. Another approach with the key agent is to switch to using PuTTY [1] instead of using the OpenSSH agent shipped with Git for Windows. PuTTY's advantage is that it's better integrated into the system, and its key manager (pageant.exe) comes in a form of a GUI app which sits in the system notification area (the tray). To use putty, you'll have to permanentry set the environment variable GIT_SSH (on a system or user level) to something like %ProgramFiles%\PuTTY \plink.exe Note that TortoiseSVN and TortoiseGit come with their own patched version of plink.exe which is able to ask mandatory quesions using a GUI dialog. So if you have one/want to use it, you could set your GIT_SSH to something like %ProgramFiles%\TortoiseSVN\bin\TortoisePlink.exe Note though that TortoiseFoos do not include the full stack of PuTTY utilities, so you have to install it anyway to use its key agent. A complete step-by-step guide (with pictures galore) on how to set up Git for Windows to work with PuTTY including using the key agent is [2]. 1. http://www.chiark.greenend.org.uk/~sgtatham/putty/ 2. http://nathanj.github.io/gitguide/index.html P.S. For the future, please note that it's futile to ask for help while provifing zero information about how the faulty program actually fails -- did not quite work is not the statement of a problem. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.