Here is the workaround:
1. disable start of ssh-agent from openssh by commenting out the use-ssh-agent
line from file "/etc/X11/Xsession.options".
2. start ssh-agent from gnome-keyring daemon and set SSH_AUTH_SOCKET variable
by adding the following to ${HOME}/.profile:
# From man gnome-keyring-daemon:
# Connect to an already running daemon and initialize it.
# This is often used to complete initialization of a daemon that was
# started by PAM using the --login argument.
# Output is SSH_AUTH_SOCKET=path_to_the_socket
if [ -z "$SSH_AUTH_SOCK" ]; then
export `/usr/bin/gnome-keyring-daemon --start`
fi
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-keyring in Ubuntu.
https://bugs.launchpad.net/bugs/1586835
Title:
ssh-agent fighting gnome-keyring on Ubuntu Gnome 16.04
Status in gnome-keyring package in Ubuntu:
Confirmed
Bug description:
Sometimes I open a terminal and try to login to a remote server, just
to be greeted by a command-line-based prompt asking for my password.
Whenever that happens, it is ssh-agent instead of gnome-keyring that
is providing the SSH agent capabilities:
$ echo $SSH_AUTH_SOCK
/tmp/ssh-qeG7CTbx4w7D/agent.4592
$ ps -p 4592 -f
UID PID PPID C STIME TTY TIME CMD
xeno 4592 4576 0 20:53 tty3 00:00:00
/usr/lib/gnome-session/gnome-session-binary --session=gnome
$ ps -p $SSH_AGENT_PID -f
UID PID PPID C STIME TTY TIME CMD
xeno 4652 4592 0 20:53 ? 00:00:00 /usr/bin/ssh-agent
/usr/bin/im-launch gnome-session --session=gnome
I usually close the GNOME Terminal and open a new one (sometimes I
must do this more than once), and I eventually get the expected
output:
$ echo $SSH_AUTH_SOCK
/run/user/1000/keyring/ssh
$ ps -p $SSH_AGENT_PID -f
UID PID PPID C STIME TTY TIME CMD
xeno 4652 4592 0 20:53 ? 00:00:00 /usr/bin/ssh-agent
/usr/bin/im-launch gnome-session --session=gnome
Interestingly, the $SSH_AGENT_PID variable seems to continue pointing
to the process where ssh-agent is running.
Generally once I get the keyring socket in the $SSH_AUTH_SOCK
environment variable, it will stay that way even when I close the
terminal and launch a new one.
This seems to be a weird conflict between two programs offering the
ssh-agent service.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/1586835/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp