From 41bc1b1ddba06de65f3bfec6b9b0c17f93f21aac Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 23 Dec 2016 01:07:53 +0200 Subject: Switch to systemd unit based SSH agent --- .bash_profile | 1 - .bashrc | 2 ++ .config/systemd/user/ssh-agent.service | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .config/systemd/user/ssh-agent.service diff --git a/.bash_profile b/.bash_profile index 0006ff8..efac808 100644 --- a/.bash_profile +++ b/.bash_profile @@ -2,6 +2,5 @@ # ~/.bash_profile # -eval `ssh-agent` [[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/.bashrc b/.bashrc index f4845b0..c8ad744 100644 --- a/.bashrc +++ b/.bashrc @@ -8,3 +8,5 @@ alias ls='ls --color=auto' alias ll='ls -la' PS1='[\u@\h \W]\$ ' + +export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" diff --git a/.config/systemd/user/ssh-agent.service b/.config/systemd/user/ssh-agent.service new file mode 100644 index 0000000..87d6c04 --- /dev/null +++ b/.config/systemd/user/ssh-agent.service @@ -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 -- cgit v1.3.1