You are not logged in.

#1 2006-09-23 18:17:48

sh__
Member
Registered: 2005-07-19
Posts: 272

Beryl / Compiz + ssh-agent? [solved]

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

#2 2006-09-23 21:17:49

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: Beryl / Compiz + ssh-agent? [solved]

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

#3 2006-09-24 20:55:02

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: Beryl / Compiz + ssh-agent? [solved]

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

#4 2006-09-28 02:47:15

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: Beryl / Compiz + ssh-agent? [solved]

sh__ wrote:

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. smile

Offline

Board footer

Powered by FluxBB