I\'ve been somewhat \'putting up\' with Github always asking for my username and password when I clone a repository. I want to bypass this step because it is an annoyance w
SSH Key - Still asking for password and passphrase
If on Windows and using PuTTY as the SSH key generator, this quick & easy solution turned out to be the only working solution for me using a plain windows command line:
pageant.exe and plink.exe.ppk extension"full\path\to\your\pageant.exe" "full\path\to\your\key.ppk" (must be quoted). This will execute the pageant service and register your key (after entering the password).GIT_SSH=full\path\to\plink.exe (must not be quoted). This will redirect git ssh-communication-related commands to plink that will use the pageantservice for authentication without asking for the password again.Done!
Note1: This documentation warns about some peculiarities when working with the GIT_SHH environment variable settings. I can push, pull, fetch with any number of additional parameters to the command and everything works just fine for me (without any need to write an extra script as suggested therein).
Note2: Path to PuTTY instalation is usually in PATH so may be omitted. Anyway, I prefer specifying the full paths.
Automation:
The following batch file can be run before using git from command line. It illustrates the usage of the settings:
git-init.bat
@ECHO OFF
:: Use start since the call is blocking
START "%ProgramFiles%\PuTTY\pageant.exe" "%HOMEDRIVE%%HOMEPATH%\.ssh\id_ed00000.ppk"
SET GIT_SSH=%ProgramFiles%\PuTTY\plink.exe
Anyway, I have the GIT_SSH variable set in SystemPropertiesAdvanced.exe > Environment variables and the pageant.exe added as the Run registry key (*).
(*) Steps to add a Run registry key>
regedit.exeHKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > RunEdit > New > String ValueEdit > Modify... (or double-click)pageant.exe and public key, e.g., "C:\Program Files\PuTTY\pageant.exe" "C:\Users\username\.ssh\id_ed00000.ppk" (notice that %ProgramFiles% etc. variables do not work in here unless choosing Expandable string value in place of the String value in step 3.).