SSH and Git on Windows (with Public\Private Key Authentication)

This Blog Post consists in huge parts of Daniel Hüskens awesome work, but I still had to rewrite it a bit as I tended to add some stuff on :).

1.) Download latest Git for Windows: https://git-for-windows.github.io/

2.) Install (Entires with * can be changed to your own liking, ** can be changed, but this setting is recommended)

  • "Without Windows Explorer Integration" *
  • "Run Git and included Unix tools from Windows Command Prompt"
  • "Use OpenSSH"
  • "Checkout Windows-style, commit Unix-style endings" **
  • "Use Windows default console window" **

3.) Configure

  • set set HOME=%HOMEDRIVE%%HOMEPATH% in your Windows User Path Variables: Press WIN+X Key, choose System, Advanced Systemsettings, Advanced, Path Variables - or just press WIN+R and enter "C:\Windows\system32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables- you will need to click on New, then create a new Variable HOME  with the Value %HOMEDRIVE%%HOMEPATH%, click ok and close everything.
  • create the Folder .ssh in your User Folder (C:\Users\YourName\)
  • if you want to store your ssh Config and Credentials somewhere else, you need to use a symlink. Start your CMD in Administrator Mode (Press Windows Key, type cmd, rightclick on the found program, start as Administrator) and create the link with mklink /D "C:\Users\YourName\.ssh" "D:\mySecretFolder\.ssh" The path D:\mySecretFolder\.ssh does have to exist before this action, .ssh in the YourName folder not :).

4.) Create a key and test access to Github

  • Go to your .ssh folder and open a CMD there
  • ssh-keygen -t rsa -C "a good comment on what this key is for" -b 4096
  • Your key has been created, it should be named id_rsa and id_rsa.pub. The content of id_rsa.pub can be added as new ssh key to your Github profile on: https://github.com/settings/keys
  • After that you can test your setup with ssh -T git@github.com
  • If anything goes wrong, add verbosity to your SSH command, i.e. with -vvv (more v's equals more debug messages)

5.) Word of advice:

SSH can be a bit tricky, as it tends to only look for id_rsa named keys in your .ssh folder. So if you have multiple keys with different names chances are high that this won't work. However, you can get around that with entries in the user defined ssh config file (called "config" and placed in the .ssh folder of the user) to tell ssh which key to use with which ssh connection. I will add a post on that topic later and link it here.
EDIT: Here is the link

Keybase.io got a new Client - and it is awesome!

Finally, Keybase.io got a new Client and it is looking gorgeous: https://keybase.io/.

They added a graphical client to the CLI and included a Chat, as well as the File transfer and Search options. So now, Keybase.io got more easy to use than ever before - and the best thing: A mobile client is soon(tm ;)) to be released.

Actually I missed the release of the client and would not have stumbled upon it, if it weren't for johanbove how send me an encrypted message via the client - and Keybase let me know via email that I got something encrypted waiting for me ;).

Seems like Johan read my last post about Keybase.io and decided to drop me a encrypted message - and as you see, thats the real power of Keybase: You just got to know someones Github/Twitter/Website/WhatEver Account Name - and you can drop her/him an encrypted message, file or chat. And that is infact the point where Keybase.io shines above the regular PGP solutions - it is PGP for the social web :).

So - cheers Johan, thanks for the message - and lot of fun for the rest of you, maybe we connect on Keybase.io - I won't give you my page now - I trust you'll find me very easily ;)!