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

Bug#852448: x11-common: ssh-agent socket removed from /tmp for long-running sessions



Package: x11-common
Version: 1:7.7+18
Severity: important

Hi. In the brave new world of systemd, /tmp tends to get cleaned fairly aggressively even while users are logged in.
I've found that after a few days my ssh agent socket gets cleaned up, and I get grumpy typing long pass phrases and unable to use smart cards.

Well, Sam, you ask, since you've fully embraced that new world, why aren't you using the ssh-agent in gnome-keyring?
Two things.  First, it doesn't support PKCS11 so I can't use a smart card.
Second, it doesn't support EC keys.

I think sticking the agent socket in XDG_RUNTIME_DIR is a better place in the modern world order.
Here's a patch.

--- 90x11-common_ssh-agent~	2010-10-13 09:29:00.000000000 -0400
+++ 90x11-common_ssh-agent	2017-01-24 09:36:32.717942114 -0500
@@ -17,6 +17,11 @@
   fi
 fi
 
+if [ -n "$XDG_RUNTIME_DIR" ]; then
+    mkdir $XDG_RUNTIME_DIR/ssh-agent
+    SSHAGENTARGS="-a $XDG_RUNTIME_DIR/ssh-agent/sock $SSHAGENTARGS"
+fi
+
 if [ -n "$STARTSSH" ]; then
   STARTUP="$SSHAGENT $SSHAGENTARGS ${TMPDIR:+env TMPDIR=$TMPDIR} $STARTUP"
 fi


-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (550, 'testing'), (500, 'stable-updates'), (500, 'stable'), (200, 'unstable')
Architecture: amd64 (x86_64)

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

Versions of packages x11-common depends on:
ii  lsb-base  9.20161125

x11-common recommends no packages.

x11-common suggests no packages.

-- Configuration Files:
/etc/X11/Xsession.d/90x11-common_ssh-agent changed [not included]

-- no debconf information


Reply to: