W3C home > Mailing lists > Public > www-archive@w3.org > June 2001

useful cygwin ssh-agent script

From: Joseph M. Reagle Jr. <reagle@MIT.EDU>
Date: Fri, 08 Jun 2001 14:19:47 -0400
Message-Id: <4.3.2.7.2.20010608141442.03033b38@localhost>
To: cygwin@w3.org
Cc: www-archive@w3.org
This is n generations tweaked, but it's now useful for me under any of my 
*nix hosts. Previously on win32 I was doing all kinds of nasty stuff with 
setx to push these variables into the global NT environment space, but the 
file approach is much simpler. (However, people should be cognizant of the 
potential dangers of ssh-agent under cygwin [1], though under a local 
netstat and remote portscan it does not appear that the port specified in 
/tmp/ssh-foo is accessible to anyone ...?)

[1] http://www.cygwin.com/ml/cygwin/2001-01/msg00063.html

SSH_ENV=$HOME/.ssh/environment

function start_agent {
     echo "Initialising new SSH agent..."
     /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
     echo succeeded
     chmod 600 ${SSH_ENV}
     . ${SSH_ENV} > /dev/null
     /usr/bin/ssh-add;
}

# Source SSH settings, if applicable

if [ -f "${SSH_ENV}" ]; then
     . ${SSH_ENV} > /dev/null
     #ps ${SSH_AGENT_PID} doesn't work under cywgin
     ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
         start_agent;
     }
else
     start_agent;
fi
--
Regards,          http://www.mit.edu/~reagle/
Joseph Reagle     E0 D5 B2 05 B6 12 DA 65  BE 4D E3 C1 6A 66 25 4E
MIT LCS Research Engineer at the World Wide Web Consortium.

* This email is from an independent academic account and is
not necessarily representative of my affiliations.
Received on Friday, 8 June 2001 14:32:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:13 GMT