From 87a110fa406f83efd020709b859e177779fa17cc Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Mon, 29 Aug 2022 07:59:23 +0200 Subject: [PATCH] add ssh-agent systemd service --- README.md | 6 +++++- ssh-agent.service | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 ssh-agent.service diff --git a/README.md b/README.md index b71cd64..634bac0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # my dots -dots for my lenovo yoga slim 7i pro 「itomori」, managed with `gnu stow`. +dots for my laptop 「itomori」, managed with `gnu stow`. Files can be `stow`'ed and un'`stow`'ed with `stow.sh`. It will link all dotfiles to their correct place. @@ -9,6 +9,10 @@ It will link all dotfiles to their correct place. Fonts are provided in `fonts/` SFMono also provides icons. +## ssh-agent(1) +Move `ssh-agent.service` to `~/.config/systemd/user/ssh-agent.service` +and start it appropriately. + ## deps ### for sway + `waybar` diff --git a/ssh-agent.service b/ssh-agent.service new file mode 100644 index 0000000..75a01c7 --- /dev/null +++ b/ssh-agent.service @@ -0,0 +1,15 @@ +# Requires SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" +[Unit] +ConditionEnvironment=!SSH_AGENT_PID +Description=OpenSSH key agent +Documentation=man:ssh-agent(1) man:ssh-add(1) man:ssh(1) + +[Service] +Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket +ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK +PassEnvironment=SSH_AGENT_PID +SuccessExitStatus=2 +Type=forking + +[Install] +WantedBy=default.target