[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#850323: openssh-client: ssh-agent x-session-manager does not restart when you log out of Gnome3 and log back in again



Package: openssh-client
Version: 1:7.4p1-5
Severity: normal

Dear Maintainer,

When I run ssh-add to add my ssh keys to the ssh-agent, everything works
fine. My environment variables are as below and ssh-agent is already
running as part of Xsession startup I assume:

$ env | egrep -i '(ssh|gpg|agent|keyring)'
SSH_AUTH_SOCK=/tmp/ssh-ueF1DWSGqjM3/agent.1322
SSH_AGENT_PID=1396
GPG_AGENT_INFO=/run/user/501/gnupg/S.gpg-agent:0:1

$ ps auxw | egrep '(ssh|gpg|agent|keyring)'
root      1027  0.0  0.0  69944  5364 ?        Ss   21:34   0:00
/usr/sbin/sshd -D
root      1066  0.0  0.0  37788  2112 ?        Ss   21:34   0:00
/bin/systemd-tty-ask-password-agent --wall
simon     1307  0.0  0.0 130784  3008 ?        Sl   21:34   0:00
/usr/bin/gnome-keyring-daemon --daemonize --login
simon     1396  0.0  0.0  11084   328 ?        Ss   21:34   0:00
/usr/bin/ssh-agent x-session-manager
simon     1519  0.0  0.0  17876   284 ?        Ss   21:34   0:00
gpg-agent --daemon
simon     1815  0.0  0.0  12784   924 pts/1    S+   21:35   0:00 grep -E
(ssh|gpg|agent|keyring)

When I then log out of Gnome, and log back in again as the same user, I
get the following error when running ssh-add:

    Error connecting to agent: No such file or directory

I have the same environment variables, but no ssh-agent process, so it
seems ssh-agent is getting run on first boot but not on subsequent
logins to Gnome.

I did some poking around Xsession.d and Xsession.options (which does
include "use-ssh-agent") and also noticed
/usr/lib/systemd/user/ssh-agent.service has a recent timestamp, so.....

$ systemctl --user status ssh-agent
● ssh-agent.service - OpenSSH Agent
   Loaded: loaded (/usr/lib/systemd/user/ssh-agent.service; static;
vendor preset: enabled)
   Active: inactive (dead)

Restarting ssh-agent.service does nothing, but looking through
journalctl shows that its started, but its not in the process list, also
seems dbus has the previous environment variables:

Jan 05 21:36:42 greivous /usr/lib/gdm3/gdm-x-session[1974]:
dbus-update-activation-environment: setting SSH_AGENT_PID=1396
Jan 05 21:36:42 greivous /usr/lib/gdm3/gdm-x-session[1974]:
dbus-update-activation-environment: setting
SSH_AUTH_SOCK=/tmp/ssh-ueF1DWSGqjM3/agent.1322
Jan 05 21:44:39 greivous systemd[1294]: Started OpenSSH Agent.


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.8.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages openssh-client depends on:
ii  adduser           3.115
ii  dpkg              1.18.18
ii  libc6             2.24-8
ii  libedit2          3.1-20160903-2
ii  libgssapi-krb5-2  1.15-1
ii  libselinux1       2.6-3
ii  libssl1.0.2       1.0.2j-5
ii  passwd            1:4.2-3.3
ii  zlib1g            1:1.2.8.dfsg-4

Versions of packages openssh-client recommends:
ii  xauth  1:1.0.9-1

Versions of packages openssh-client suggests:
pn  keychain                         <none>
pn  libpam-ssh                       <none>
pn  monkeysphere                     <none>
ii  ssh-askpass-gnome [ssh-askpass]  1:7.4p1-5

-- no debconf information


Reply to: