I've gotten used to having my X sessions started with ssh-agent, so I'm including my diff to /etc/X11/xdm/Xsession from xfree-4.2.0-r10. The non-chooser cases need to be tested. If you'd prefer to incorporate a known quantity, Debian and OpenBSD both do this. Debian has an /etc/X11/Xsession.d containing a number of scripts, one of which sets up ssh-agent. OpenBSD's is more straightforward, but I'm unclear on the benefit of not simply using ssh-agent to exec the session. Anyway, you can check OpenBSD's out via CVSweb at: http://www.openbsd.org/cgi-bin/cvsweb/XF4/xc/programs/xdm/config/Xsession?rev=1.6&content-type=text/x-cvsweb-markup Here's the diff: --- Xsession.orig Tue May 28 19:32:59 2002 +++ Xsession Tue May 28 21:22:40 2002 @@ -26,17 +26,20 @@ fi startup=$HOME/.xsession resources=$HOME/.Xresources +SSH_AGENT="" +[ -x /usr/bin/ssh-agent ] && SSH_AGENT=/usr/bin/ssh-agent + if [ -n "`/etc/X11/chooser.sh`" ]; then - exec "`/etc/X11/chooser.sh`" + exec ${SSH_AGENT} "`/etc/X11/chooser.sh`" elif [ -s "$startup" ]; then if [ -x "$startup" ]; then - exec "$startup" + exec ${SSH_AGENT} "$startup" else - exec /bin/sh "$startup" + exec ${SSH_AGENT:-/bin/sh} "$startup" fi else if [ -r "$resources" ]; then xrdb -load "$resources" fi - exec xsm + exec ${SSH_AGENT} xsm fi
have you considered keychain?
Doh! I hadn't, but it looks good. Thanks.