How do I disable gnome-keyring ssh integration?

Just copy the relevant .desktop file from /etc/xdg/autostart to ~/.config/autostart and add Hidden=true to it:

(cat /etc/xdg/autostart/gnome-keyring-ssh.desktop; echo Hidden=true) > ~/.config/autostart/gnome-keyring-ssh.desktop

then reload gnome-shell (press Alt + F2, then type r and press Enter).

This is the only user-friendly solution that has worked for me (ie not having to softlink the .desktop file to /dev/null or chmod 0 the gnome-keyring-daemon). In fact, softlinking to /dev/null stopped working for me in GNOME 3.16.

Credit goes to nus.


I can't speak for Ubuntu releases other than Trusty — and GNOME is such a constant moving target that you can guarantee that every release will be different — but this is what I've found to most reliably work:

mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/gnome-keyring-ssh.desktop ~/.config/autostart/
echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/gnome-keyring-ssh.desktop

Session start up under Unity, at least, and quite probably GNOME3, too, is weird: it will run Upstart scripts out of /usr/share/upstart/sessions/ and then runs all the autostart desktop entries under /etc/xdg/autostart and gnome-keyring, and many other things are in both (and it probably runs things in /usr/share/upstart/xdg/autostart, too; I didn't test that).

The gnome-keyring-ssh upstart entry will check for that X-GNOME-Autostart-enabled=false line in either the system or user local .desktop entry and back out, then the standard ssh-agent session will run. The system-wide gnome-keyring-ssh will then start up out of /etc/xdg/autostart unless you have a matching entry in your user local autostart, in which case that will be run instead.

It used to be enough just to have that enable=false line in the local autostart, but sometime recently (as in, since May 2016, over two years into Trusty's LTS period) that behaviour changed and you need something resembling a full entry. I'm still investigating the precise set of keys necessary, and the offending package update responsible.

Why the GNOME people didn't just proxy through to the OpenSSH key agent is anyone's guess. You might like to suggest they adopt a more sensible behaviour in this Bugzilla entry.