Shell access to github in windows

In my first post I shared a proxy script that changes and configures different programs that I regularly use as per my current network settings in Ubuntu 13.04. Now that script works fine. However, in Windows, I mentioned how we can create almost global proxy settings that would work with all the Metro apps as well. Github has a windows application and it has a pretty neat interface and we have a git shell as well as the desktop application to work with. During the installation of the application, it sets are account up with ssh keys as well, so there aren’t any hassles. What if we are behind an http or socks proxy and thus have pretty much every port blocked on the network except for the bare minimum. In my college port 22 is blocked and therefore shell access becomes difficult

In ubuntu I used corkscrew which quite simply tunnels ssh traffic through http/https and therefore we can ssh into any server through that proxy. It’s really simple to set up, all I did was add the following lines to my ~/.ssh/config file:

I was having a similar problem with getting shell access to github in Windows. Now, corkscrew has support for Windows if you’re using Cygwin which I highly recommend because it has loads of precompiled binaries that you normally get on *Nix systems and thus is really helpful. I decided to give connect.c a try on Windows after going through a couple of answers on Stackoverflow. Quite simply that C Program lets us connect to sockets through Socks or http tunnel. The script is heavily documented with clear instructions on how to compile on windows or other distributions. I also have a pre-compiled binary which I created for those who don’t want to compile from source or don’t have gcc set up. Just like in Ubuntu if you have Openssh or git bash installed on your system, just go to C:\Users\vivek\.ssh (Replcae ‘vivek’ with your username) and add the following lines to the config file (Create a config file if one doesn’t exist already):

*github_rsa is my private key file and please take extra care of the paths of files being entered.

*If you’re using the default command prompt on Windows, simply edit the corresponding path variables for ‘ssh’ and your ssh config file accordingly

I have all the git binaries installed at C:\Program Files (x86)\Git\bin, simply add it to your path and then you should be good to go. If the ssh program doesn’t automatically read your config file from the default location you can force it to read a file from a specific path with the “-F” command switch.

Once of you have this set up, simply fire up git Bash and try:

This should help you debug error messages if any and ultimately present you with a message saying “Hi <YourGithubUserName>! You’ve successfully authenticated, but GitHub does not provide shell access.” Although Github prefers https method over secure shell for users, some of us still like to work with keys and ssh is quite secure so this should set you up with a good git workflow.