From a7cb8415182d0637d52208a4c60734991431be85 Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Fri, 24 Apr 2020 02:22:15 +0200 Subject: [PATCH] ssh-agent as a systemd user service --- .config/systemd/user/ssh-agent.service | 11 +++++++++++ .profile | 2 ++ .xinitrc | 3 --- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .config/systemd/user/ssh-agent.service diff --git a/.config/systemd/user/ssh-agent.service b/.config/systemd/user/ssh-agent.service new file mode 100644 index 0000000..743f837 --- /dev/null +++ b/.config/systemd/user/ssh-agent.service @@ -0,0 +1,11 @@ +[Unit] +Description=ssh-agent + +[Service] +Type=simple +Environment="SSH_AUTH_SOCK=%t/ssh-agent.socket" +Environment="SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass" +ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK + +[Install] +WantedBy=default.target diff --git a/.profile b/.profile index 06f7d46..9737789 100644 --- a/.profile +++ b/.profile @@ -13,3 +13,5 @@ export QT_IM_MODULE=ibus export THETVDB_API_KEY=49B26BFAFD11B0F3 export TR_AUTH=":" export PATH=$HOME/.config/bin:/usr/local/bin:$PATH +export SSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/ssh-agent.socket +export SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass diff --git a/.xinitrc b/.xinitrc index 3053153..6d16cfd 100644 --- a/.xinitrc +++ b/.xinitrc @@ -14,7 +14,4 @@ fi ibus-daemon -drx -eval $(ssh-agent) -export SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass - exec ./.bspwm-session