]> git.rmz.io Git - dotfiles.git/commitdiff
ssh: add systemd unit for ssh-agent
authorSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 24 Oct 2016 08:19:23 +0000 (09:19 +0100)
committerSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 24 Oct 2016 08:19:23 +0000 (09:19 +0100)
systemd/user/ssh-agent.service [new file with mode: 0644]
zshenv

diff --git a/systemd/user/ssh-agent.service b/systemd/user/ssh-agent.service
new file mode 100644 (file)
index 0000000..87d6c04
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=SSH key agent
+
+[Service]
+Type=forking
+Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
+ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK
+
+[Install]
+WantedBy=default.target
diff --git a/zshenv b/zshenv
index fb9c7abb28472e4cb5189ce117e944fcb315c354..06037be8e945bc0b563f9ef39a3eaa06e4bb71e0 100644 (file)
--- a/zshenv
+++ b/zshenv
@@ -42,3 +42,7 @@ export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
 
 # pass
 export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
+
+# SSH Agent
+export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
+