May 042011

So it seems that xfce now, if gpg is installed, will use gpg-agent to manage your ssh keys rather than ssh-agent.

Frustrated by this, since it failed to load my ssh keys, I’ve finally figured out how to get xfce to not use gpg-agent. You need to set a couple of properties in the “xfconf properties DB”, that xfce checks when starting up. The simplest way to do that is to use the Setting Editor (aka the xfce4-settings-editor program) and add in the two following properties under the xfce4-session Channel:

/startup/ssh-agent/enabled (a boolean) to enabled
/startup/ssh-agent/type (a string) to ssh-agent

The trick is to make sure you type in the full path to the properties when creating them, otherwise the Setting Editor crashes.

Details, if you care…

I figured this out by first noticing that I couldn’t load my ssh keys using ssh-add (perhaps there is a gpg tool for this, I dunno). Looking at ps output I noticed there was no ssh-agent process running but there was a gpg-agent process running with an --enable-ssh-support arg passed to it. To figure out how to change that, I starting by looking at the /usr/local/bin/startxfce4 script which, in my case, ends up using /usr/local/etc/xdg/xfce4/xinitrc to start X via xinit.

In that xinitrc file, searching for “agent” there are some xfconf-query calls, which seems to be how xfce’s properties DB is queried. I tried using that xfconf-query to create new properties but couldn’t seem to get it to work. It sure looks like that’s possible, but the documentation on it is pretty much non-existent as far as I could tell. When I first came across this, I punted and just commented out the code in xinitrc, but after rebuilding something (xfce itself probably) I lost those changes as was back to not being able to load my ssh keys.

This time I tried using the GUI Setting Editor app which worked, as long as you type in the full path of the property to set. After that, I noticed that this properties DB is kept in xml files under a ~/.config/xfce4/xfconf/xfce-perchannel-xml/ dir. So perhaps this could have also been done by adding some xml code into the xfce4-session.xml file there.

 Posted by at 3:46 pm  Tagged with: ,