--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: systemd user unit to start ssh-agent
- From: Moritz Muehlenhoff <jmm@debian.org>
- Date: Sun, 14 Jun 2015 19:56:58 +0200
- Message-id: <20150614175658.24127.11072.reportbug@pisco.westfalen.local>
Package: openssh-client
Version: 1:6.7p1-6
Severity: wishlist
Tags: patch
Hi,
I'm using the attached systemd user unit to startup
ssh-agent.
Cheers,
Moritz
diff -Naur openssh-6.7p1.orig/debian/openssh-client.install openssh-6.7p1/debian/openssh-client.install
--- openssh-6.7p1.orig/debian/openssh-client.install 2015-03-23 00:08:49.000000000 +0100
+++ openssh-6.7p1/debian/openssh-client.install 2015-06-11 11:33:20.443877625 +0200
@@ -35,3 +35,4 @@
# Upstart user job (only used under user sessions).
debian/ssh-agent.user-session.upstart => usr/share/upstart/sessions/ssh-agent.conf
+debian/ssh-agent.service => /usr/lib/systemd/user
diff -Naur openssh-6.7p1.orig/debian/README.Debian openssh-6.7p1/debian/README.Debian
--- openssh-6.7p1.orig/debian/README.Debian 2015-03-23 00:08:49.000000000 +0100
+++ openssh-6.7p1/debian/README.Debian 2015-06-11 11:31:27.618079976 +0200
@@ -229,6 +229,19 @@
copying /lib/systemd/system/ssh.socket to /etc/systemd/system/ssh.socket and
modifying the ListenStream option. See systemd.socket(5) for details.
+Starting ssh-agent with systemd
+-------------------------------
+
+ssh-agent can be launched through a systemd user unit. The unit is shipped
+as /usr/lib/systemd/user/ssh-agent.service.
+
+It needs to be enabled on a per-user basis by running
+
+systemctl --user enabled ssh-agent
+
+It creates a socket ssh-agent.socket inside the $XDG_RUNTIME_DIR directory,
+so make sure your environment variable $SSH_AUTH_SOCK points to that.
+
--
Matthew Vernon <matthew@debian.org>
Colin Watson <cjwatson@debian.org>
diff -Naur openssh-6.7p1.orig/debian/ssh-agent.service openssh-6.7p1/debian/ssh-agent.service
--- openssh-6.7p1.orig/debian/ssh-agent.service 1970-01-01 01:00:00.000000000 +0100
+++ openssh-6.7p1/debian/ssh-agent.service 2015-06-11 11:31:47.670372124 +0200
@@ -0,0 +1,11 @@
+[Unit]
+Description=SSH authentication agent
+Before=default.target
+
+[Service]
+Type=forking
+Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
+ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK
+
+[Install]
+WantedBy=default.target
--- End Message ---
--- Begin Message ---
- To: 788745-done@bugs.debian.org
- Subject: Re: Bug#788745: systemd user unit to start ssh-agent
- From: Colin Watson <cjwatson@debian.org>
- Date: Sun, 2 Apr 2017 02:24:42 +0100
- Message-id: <20170402012442.GM9002@riva.ucam.org>
- In-reply-to: <20150614175658.24127.11072.reportbug@pisco.westfalen.local>
- References: <20150614175658.24127.11072.reportbug@pisco.westfalen.local>
Source: openssh
Source-Version: 1:7.2p2-8
On Sun, Jun 14, 2015 at 07:56:58PM +0200, Moritz Muehlenhoff wrote:
> I'm using the attached systemd user unit to startup
> ssh-agent.
Thanks. I added a similar-in-spirit unit in response to #832445, having
forgotten about this bug. Hopefully that meets your needs; if not,
please let me know what needs to change and why.
--
Colin Watson [cjwatson@debian.org]
--- End Message ---