This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] Updated: keychain-2.0.3-1

Hi All...

I believe I found a small bug in the latest keychain. For Cygwin, keychain now does a
"ps -e -u <username> -f" to look for ssh-agent processes...I believe it should be a
"ps -u <username> -f" instead.

The reason is as follows...the -e shows processes for all users. If multiple users have ssh-agent
processes hanging around, keychain can find the wrong one and this produces some strange
results. I may be the only one to see this because ssh-agent processes don't usually survive
a logoff. I launch keychain from a service for each user (that wants the feature) so that the
agent stays around for multiple logon/off sessions...that way, they live untill the next reboot.

The attached patch file removes the -e option and also creates a third output file in the
.keychain directory. The new file is ~/.keychain/${HOSTNAME}.cmd so that programs
launched from a windows command shell can also use keychain.

The second attachment is a script to launch keychain as a service for those interested in
surviving multiple logon/off sessions. Just use it to create a service for each user that wants
the feature. The service only sets up the ssh-agent. The keys are loaded from the .profile
and the passphrase(s) are entered then.



From: Hack Kampbjorn <>
Subject: Re: [ANNOUNCEMENT] Updated: keychain-2.0.3-1
Date: Tue, 25 Nov 2003 01:18:45 +0100

Steven Woody wrote:
alreay have ssh-agent + ssh-add, why people need keychain?

keychain is just a script around ssh-agent and ssh-add, you don't get any
functionality you can achieve with some little scripting using ssh-agent and
ssh-add directly.

If all you ever do with ssh-agent is `eval $(ssh-agent)` and you don't get
orphan agent in ps. Try `ps -e -u $(whoami) -f` do you have more than one
ssh-agent? If so take a look at keychain it will help you to kill all orphan
agent and only start one no matter how many times you log in.

I'm continually opening rxvt windows and closing them, before I used keychain I
easily ended up with 10 agents or more (even if I stopped the agent in the
logout script). I was about to add some ssh-agent logic to my profile but it was
easier (and faster) to make a cygwin package for keychain and change two lines
in my .bash_profile (which I use on cygwin, linux, and *BSD, it should also work on AIX, SunOS, Solaris, HP/UX ...).

Med venlig hilsen / Kind regards

Hack Kampbjørn

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Need a shot of Hank Williams or Patsy Cline? The classic country stars are always singing on MSN Radio Plus. Try one month free!

Attachment: keychain-patch
Description: Text document

Attachment: keychain-service-install
Description: Text document

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]