From 17fcf842da1e5ab6e571e1c80f2013986de7150c Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 15 Dec 2017 14:42:06 -0800 Subject: [PATCH] add ssh-agent --- .config/systemd/user/default.target.wants/ssh-agent.service | 1 + .config/systemd/user/ssh-agent.service | 10 ++++++++++ .zprofile | 1 + 3 files changed, 12 insertions(+) create mode 120000 .config/systemd/user/default.target.wants/ssh-agent.service create mode 100644 .config/systemd/user/ssh-agent.service diff --git a/.config/systemd/user/default.target.wants/ssh-agent.service b/.config/systemd/user/default.target.wants/ssh-agent.service new file mode 120000 index 0000000..8c9a931 --- /dev/null +++ b/.config/systemd/user/default.target.wants/ssh-agent.service @@ -0,0 +1 @@ +/home/barak/.config/systemd/user/ssh-agent.service \ No newline at end of file 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 diff --git a/.zprofile b/.zprofile index 3beeed0..7296da2 100644 --- a/.zprofile +++ b/.zprofile @@ -37,3 +37,4 @@ ENV=$HOME/.zshrc; export ENV #alias ls='ls -FG' #alias la='ls -FGal' #source ~/.zshrc +export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"