You are not logged in.
I'm playing with compiz-quinn-cvs (aiglx + compiz only, no gnome deps). Has anyone figured out how to use ssh-agent in this setup?
With an ordinary wm, the relevant line in ~/.xinitrc would be
exec ssh-agent ordinarywm
However, when I try
exec ssh-agent dbus-launch compiz [options...]
compiz starts fine but does not see the agent:
$ ssh-add
Could not open a connection to your authentication agent.
There are workarounds that bind the agent to a specific terminal, but that is less convenient than having the agent available sessionwide. Any suggestions?
Offline
I start it from the shell (like you mentioned):
export SSH_AUTH_SOCK=~/tmp/matt-sshagent/SSHAuthSock
if [ ! -d ~/tmp/matt-sshagent ]
then
mkdir ~/tmp/matt-sshagent
chmod 700 ~/tmp/matt-sshagent
fi
if [ ! -S $SSH_AUTH_SOCK ]
then
ssh-agent -a $SSH_AUTH_SOCK
ssh-add
fi
It works because when I run startx it picks up all env. var. from my shell. With this method you have to enter your key pass as soon as you log in (when the first shell is opened).
Offline
Yes, that would work if you run all ssh commands from a shell.
Anyway, I was confused about how dbus-launch works. Putting this in X initialization scripts does the job as I originally intended:
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
exec /usr/bin/ssh-agent /usr/bin/compiz [options...]
It is not even necessary to start the dbus daemon from /etc/rc.conf.
UPDATE: The above script is b0rked after upgrading compiz-quinn-cvs to beryl-svn. Here is the fix:
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
if test -z "$SSH_AUTH_SOCK" ; then
eval `ssh-agent -s`
fi
emerald &
beryl-manager &
exec /usr/bin/beryl --indirect-rendering --strict-binding dbus settings
Offline
Yes, that would work if you run all ssh commands from a shell.
Well, it works for any application, even if launched from a menu or by some other method.
Your way seems more correct, though.
Offline