Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ssh-agent clone for cygwin that proxies to pageant

branch: master

Merge pull request #17 from ggiesen/master

Patch charade.c to fix compile problems on Cygwin64
latest commit a9afa85aac
Wesley Darlington authored August 09, 2013
Octocat-spinner-32 contrib Use proper naming so we dont need to call the patch explicitly February 26, 2013
Octocat-spinner-32 .gitignore Clean build, zero functionality. November 18, 2009
Octocat-spinner-32 LICENCE Sanify the copyright messages. December 11, 2009
Octocat-spinner-32 Makefile Make a binary tarball with 'make binary' September 30, 2010
Octocat-spinner-32 README.md Correct path to the keychain/hostname-sh file. February 26, 2013
Octocat-spinner-32 TODO Partial exec implementation November 30, 2009
Octocat-spinner-32 VERSION Make a binary tarball with 'make binary' September 30, 2010
Octocat-spinner-32 charade.c Patch charade.c to fix compile problems on Cygwin64 August 09, 2013
Octocat-spinner-32 cmdline.c Fix link errors on getopt variables. September 30, 2010
Octocat-spinner-32 cmdline.h OK, it doesn't exit immediately after working, which is nice. November 19, 2009
Octocat-spinner-32 copyright.c Sanify the copyright messages. December 11, 2009
Octocat-spinner-32 copyright.h Sanify the copyright messages. December 11, 2009
Octocat-spinner-32 depend.sh OK, simple makefile that works on cygwin at least. November 10, 2009
Octocat-spinner-32 eprintf.c Now it works as a drop-in replacement for ssh-agent. Sweet. November 23, 2009
Octocat-spinner-32 eprintf.h Don't assume that data will come all in one read(). November 25, 2009
Octocat-spinner-32 generate-copyright.pl Sanify the copyright messages. December 11, 2009
Octocat-spinner-32 install.sh Make a binary tarball with 'make binary' September 30, 2010
Octocat-spinner-32 pageant.c Set the security info for the file mapping to the same as February 13, 2011
Octocat-spinner-32 pageant.h Set the security info for the file mapping to the same as February 13, 2011
Octocat-spinner-32 todo.h The forked agent doesn't work yet. Either I've misunderstood fork() November 23, 2009
README.md

Intro

Charade is an ssh-agent in cygwin that proxies requests to pageant.

If you don't use cygwin or pageant, you don't need charade. If you're happy with plink, you don't need charade. (I love putty, but I prefer openssh to plink.)

Background: I tolerate Windows XP. I actually quite like it. But it needs putty, and it needs cygwin to be usable. I used to maintain two separate sets of ssh keys: one for putty, which I kept in pageant, and another for cygwin's openssh, which I kept in ssh-agent/keychain.

Eventually I got fed up maintaining two key pairs and charade was born.

Charade just pretends to be ssh-agent on one side and putty on the other. It's a shim between openssh and pageant.

It aspires to be a drop-in replacement for ssh-agent, and that's how I use it atm. It works for me. It probably won't work for you.

I stole large swaths of code from (i) Simon Tatham's putty (mostly putty-src/windows/winpgntc.c) and (ii) openssh's (and Tatu Ylonen's and Marcus Friedl's) ssh-agent.c.

Also check out cuviper's ssh-pageant, which does something similar.

Russell Davis has a clever way of setting environment variables at boot so that processes launched outside your shells can also use your ssh keys.

Required cygwin packages

  • gcc-g++
  • make
  • keychain
  • openssh
  • psmisc

Installation instructions

  1. Clone the repository

    git clone git://github.com/wesleyd/charade.git
    
  2. Build and install charade

     make && make install
    
  3. Stop running charade or ssh-agent processes

     killall charade   # Only if upgrading
    
     killall ssh-agent   # Only if not upgrading
    
  4. Remove existing keychain files to clear references to ssh-agent

     rm -rf ~/.keychain
    
  5. Add these two lines to ~/.bash_profile:

     keychain -q -Q
    
     . ~/.keychain/`hostname`-sh
    
  6. Logout, launch a new shell or putty and try it out

    ssh git@github.com
    

If you have a key in pageant, you should be able to go where it points.

It just forwards ssh messages, so surprising (to me!) things Just Work, like adding keys with ssh-add instead of through the pageant gui.

Wesley Darlington, December 2009.

Something went wrong with that request. Please try again.