From 59893b6a008bd7a0fa850d8f2d8b177ac282c539 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 11 Sep 2020 12:17:00 +0200 Subject: [PATCH] [ADD][SSH] ssh-agent service using systemd I needed to enable the service after linking the package. This might be better served by yet another step during my Makefile-based installation? I do not do it enough to warrant adding yet more steps for this functionality. --- Makefile | 5 +++++ ssh/.config/systemd/user/ssh-agent.service | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 ssh/.config/systemd/user/ssh-agent.service diff --git a/Makefile b/Makefile index 6e11c5f..697250b 100644 --- a/Makefile +++ b/Makefile @@ -157,6 +157,11 @@ stow-scripts: scripts mkdir -p $(STOW_TARGET) $(STOW) $< +stow-ssh: ssh + $(STOW) $< + # Enable & start ssh-agent service + systemctl enable --now --user ssh-agent.service + stow-system-X: STOW_TARGET=/ stow-system-X: system-X sudo $(STOW) $< diff --git a/ssh/.config/systemd/user/ssh-agent.service b/ssh/.config/systemd/user/ssh-agent.service new file mode 100644 index 0000000..9428410 --- /dev/null +++ b/ssh/.config/systemd/user/ssh-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=SSH key agent + +[Service] +Type=simple +Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket +ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK + +[Install] +WantedBy=default.target