- Pageant’s security measures reject the proxy request due to the two processes running with different SIDs.
- The proxy agent isn’t seen by any processes launched from your outside your shell (since the environment variables only get set in ~/.bash_profile)
Here’s my solution for issue #2. Instead of running keychain at the start of every login shell, just run it once at Windows startup, and set the environment variables system-wide using setx. Here’s my shell script that does that:
#!/usr/bin/sh
# Be sure to run this script in a login shell so that cygwin paths are properly
# set, otherwise the Windows version of hostname will run and mess things up
/usr/bin/keychain -q -Q
# The -csh script works perfectly since we can just substitute setx for setenv
alias setenv=setx
. ~/.keychain/`hostname`-csh
Update:# Be sure to run this script in a login shell so that cygwin paths are properly
# set, otherwise the Windows version of hostname will run and mess things up
/usr/bin/keychain -q -Q
# The -csh script works perfectly since we can just substitute setx for setenv
alias setenv=setx
. ~/.keychain/`hostname`-csh
Since this is only running once at startup, keychain isn’t really needed. And to simplify a bit more, it can be done in a batch file:
REM Kill any existing instances first
killall charade
SET FN=%TEMP%\ssh-agent-init.bat
REM The -csh script works perfectly since we can just substitute setenv for setx
charade -c | sed 's/setenv/setx/' | sed 's/;$//' > %FN%
call %FN%
del %FN%
killall charade
SET FN=%TEMP%\ssh-agent-init.bat
REM The -csh script works perfectly since we can just substitute setenv for setx
charade -c | sed 's/setenv/setx/' | sed 's/;$//' > %FN%
call %FN%
del %FN%
Nice one. I've made a note in the readme. Thanks!
ReplyDelete