I want to use the real ssh-agent instead of gnome-keyring in xubuntu. I followed the steps from http://dtek.net/blog/how-stop-gnome-keyring-clobbering-opensshs-ssh-agent-ubuntu-1204, but gnome keyring still registers itself as ssh-agent. I still want to keep using gnome-keyring for other passwords
|
It turns out that if gnome compatibility is turned on in xfce, xfce4-session will unconditionally start gnome-keyring-daemon. This is hardcoded, there is at the moment no way to configure this. Disabling the gnome compatibility mode results in keyring not starting on login and you will need to provide your password again if you start it. The simplest solution seems to be to intercept the call to gnome-keyring-daemon, and insert a script that will insert the Run the following to move gnome-keyring-daemon:
create a new gnome-keyring-daemon with
and insert the following content:
Make the new gnome-keyring-daemon executable with Now gnome keyring will no longer try to replace ssh-add. Note that upgrading your system will reinstate the default gnome-keyring-daemon, so you will probably need to execute the above steps again after upgrading. edit: In xubuntu 14.10 startup works slightly different in that g-k-d is also started from the session upstart. It is possible to override the upstart configuration so it won't start the ssh component, but even so g-k-d will start its ssh component when xfce4-session also tries to start it. So if you want to have xfce also automatically start gnome services you will still need the above hack. An alternative is to disable gnome services (Setings -> Session and Startup -> advanced -> Launch GNOME services on startup), configure upstart to start g-k-d with the (Apart from the two places that launch g-k-d mentioned above, the g-k-daemon is also started before that from lightdm/PAM in order to receive the user's login password. But that launch does not fully configure g-k-d and it still expects to be fully configured by a second attempt to start it, so that start attempt is not relevant to the current problem.) |
|||||
|
|
To build on the answer by @JanKanis, I traced it down to xfce4-session being the culprit for initiating the gnome-keyring-daemon --start command. When run that way gnome-keyring-daemon does not check for SSH_AUTH_SOCK already being set, which is a "feature", since you then can have both ssh-agent and gnome-keyring-daemon providing a socket. First things first: Add
Now replace gnome-keyring-daemon with a wrapper (I moved the original to /usr/libexec/):
The debug code is there for you to figure out why it stopped working. Since none of these programs have sane configuration methods, there is just no way around hacking commands. In this case, I can't find any documented configuration method for xfce4-session to not envoke gnome-keyring-daemon --start, that has no other side-effects. They all make ass-sumptions about things being installed and thus go ahead read the user's mind. |
|||
|
|
|
It's an old thread but my workaround for this problem on Xubuntu 14.04 is simple by just respawning
We remove "ssh" from the component of Gnome keyring.
Try to log out your XFCE session and log in back. To make sure Gnome keyring does not manage ssh anymore just run.
If you got that message means Gnome keyring is not manage your SSH and you're free to use the original OpenSSH ssh-agent implementation. |
|||||||||
|
|
Here's a less invasive version of the script JanKanis posted. It accepts whatever components were passed to it, but yanks out the SSH component.
|
|||||||||
|
|
I've just encountered this problem on Xubuntu 16.04, and I too wanted both Firstly, I didn't care about gnome-keyring, so I removed all related packages. eg.
At this point To help find the culprit I created a custom session file:
I then created a custom
I logged out, restart lightdm and logged in again (with the "Xsession" session selected), and inspected Poking around, I eventually stumbled upon this:
Seems
Log out and in once more, and you should be sorted. You should also now be able to delete |
|||||||||
|