Why can't I install Git for Windows with OpenSSH?

6,317

I've run into this before. Much needs to be done to switch to OpenSSH.

  1. Edit C:\Program Files (x86)\Git\setup.ini and REMOVE the following lines (IF they are in the file):

    GIT_SSH=C:\Program Files (x86)\PuTTY\plink.exe
    SVN_SSH=C:\Program Files (x86)\PuTTY\plink.exe
    
  2. Edit C:\Program Files (x86)\Git\etc\profile and REMOVE the line

    export PLINK_PROTOCOL=ssh
    
  3. Make sure you have an SSH private key file. File is in OpenSSH format NOT in PuTTY private key format, .ppk.

  4. Create a .ssh directory for the Git user and copy the id_rsa file there.

    md c:\Users\Git_User\.ssh
    
  5. Open a DOS command Window and type in the command

    set | more
    

    Look for GIT_SSH and SVN_SSH

  6. If found, this indicates that it is configured in the Windows Environmental variables. You will need to remove it from there.

From the Start Menu, open the Control Panel

  • Select User Accounts
  • Select Change my environment variables
  • Highlight GIT_SSH ...
  • Click on Delete
  • Click on OK

Repeat this for SVN_SSH.

On my machine, doing these operations DISABLES TortoiseGit. It might be better to fix your Git config to use TortoiseGitPlink.exe. There is also a TortoisePlink.exe in the TortoiseGit/bin directory - don't use it. TortoisePlink.exe does NOT work for me.

Share:
6,317

Related videos on Youtube

Taylor Hx
Author by

Taylor Hx

Information Technology Consultant, Full-Stack Developer, Systems Administrator, DevOps Engineer and Video Game Enthusiast. Raised in SME, Wearer of Many Hats. Melbourne, Australia.

Updated on September 18, 2022

Comments

  • Taylor Hx
    Taylor Hx almost 2 years

    Whenever I try to install Git for Windows, using the installer downloaded from here, the installation seemingly skips the step where I configure my Secure Shell client for Git.

    Normally during installation, a screen prompting the user to choose one of either OpenSSH (installed with Git) or PuTTY PLink (the default option) is shown. With my latest few installs, this screen is nowhere to be found. Instead, Git seems to be silently configured to use PLink without any input from me.

    Can anyone tell me why this is happening?

    If I cannot choose which SSH client to use at installation, can anyone tell me how to reconfigure Git to point to OpenSSH instead of TortoisePLink?

    This seems to controlled by a Git environment variable (mine reads "GIT_SSH=c:\Program Files\Putty\plink.exe" as opposed to "GIT_SSH=ssh.exe" as it does on another PC with Git working).

    As a work around, does anyone know how to change this variable?

  • Taylor Hx
    Taylor Hx about 10 years
    +1. Thanks for the info. Unfortunately, I don't have the offending PC's with me anymore, do I can't test this, but I will try this next time I encounter the issue.