Ealier I already wrote about using the gnome-keyring-daemon to automatically unlock the SSH key when logging into XFCE. The method I described in the latter of my posts had the drawback of launching a complete GNOME session together with all its associated services.

The way the developers of the daemon intended it to work uses DBUS to inject the global variables pointing the various sockets to be used by SSH and GnuPG into the global session environment. However XFCE does not support this injection which currently is one of the magic things happening when launching the GNOME environment at login time.

More information on the current state of the issue can be found in Redhat's Bugzilla in bug 551508. The workaround depicted there is to place the following into your ~/.profile file (or any other file evaluated during session initialization):

# add gnome-keyring-daemon to env
export `gnome-keyring-daemon --start`

In XFCE you can change the screen DPI in the Font tab in the Appearance dialog, which will instantly take effect. If you want to script the change, e.g. when upon connection with a docking station, you can use the following command:

xfconf-query -c xsettings -p /Xft/DPI -s <NEW_DPI>

To display the current DPI, you can just omit the -s <NEW_DPI> part.

The problem

Some time ago, I manually hacked together a working setup to use gnome-keyring-daemon in xubuntu to automatically unlock my ssh key when logging in. This setup broke when I upgraded to Ubuntu Lucid and I have never tried to fix it in Maverick and Natty. With the arrival of Oneiric, I gave the gnome-keyring-daemon another try. Lo and behold - it works!

The fix

To enable the gnome-keyring-daemon, make sure to have GNOME services enabled in the XFCE session settings. Then add an entry to the xfconf database with the following command: xfconf-query -v -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false

That should do the trick. You can manage your keys using the seahorse GUI.

Oh how I longed for that feature: Whenever I log into XFCE, I want my ssh key to be automatically added to my authentication agent. Although it took some time, I finally puzzled together all the pieces to make it work. So here it is. 3 simple steps to get auto-adding to work in Xubuntu karmic koala:
  1. Enable "start gnome environment" in XFCE settings
  2. Comment out the line "use-ssh-agent" in /etc/X11/Xsession.options. This prevents the ssh-agent from starting. Instead gnome-keyring-daemon's internal agent will be used. However ssh-agent would overwrite it's socket variable, so we disable it here.
  3. Place the following into your ~/.xprofile: if [ -n "$GNOME_KEYRING_PID" ]; then eval `gnome-keyring-daemon --start` export SSH_AUTH_SOCK fi
There you go. If it does not work after a re-login, leave a comment below. Further information regarding the GNOME startup process and the way gnome-keyring-daemon gets started (it's actually started twice, huh!) can be found in this bug report.

16. April 2010: Update for Lucid Lynx

Apparently my fix from above prevents things from working Lucid. Therefore, if you have problems, unset everything and it should work. Nice. It seems to be totally broken in lucid. After wasting already to much time for this, I filed a bug report about it, we'll see what happens: https://bugs.launchpad.net/ubuntu/+source/xfce4-session/+bug/564831.