From 01f3b54adf4daf307bbd6ce5c6d14c5683673eea Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Thu, 23 Mar 2023 21:09:34 -0500 Subject: [PATCH] added systemd unit to autostart ssh-agent --- neovim/.config/nvim/spell/en.utf-8.add | 5 +++++ .../.config/systemd/user/ssh-agent.service | 10 ++++++++++ ssh/.ssh/config | 1 + zsh/.zshrc | 2 ++ 4 files changed, 18 insertions(+) create mode 100644 ssh-agent-systemd/.config/systemd/user/ssh-agent.service create mode 100644 ssh/.ssh/config diff --git a/neovim/.config/nvim/spell/en.utf-8.add b/neovim/.config/nvim/spell/en.utf-8.add index 3e247e9..8b830bb 100644 --- a/neovim/.config/nvim/spell/en.utf-8.add +++ b/neovim/.config/nvim/spell/en.utf-8.add @@ -24,3 +24,8 @@ Kata ctl NDSU rebasing +posix +tmux +keybinds +dotfile +dotfiles diff --git a/ssh-agent-systemd/.config/systemd/user/ssh-agent.service b/ssh-agent-systemd/.config/systemd/user/ssh-agent.service new file mode 100644 index 0000000..9428410 --- /dev/null +++ b/ssh-agent-systemd/.config/systemd/user/ssh-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=SSH key agent + +[Service] +Type=simple +Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket +ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK + +[Install] +WantedBy=default.target diff --git a/ssh/.ssh/config b/ssh/.ssh/config new file mode 100644 index 0000000..b1425ef --- /dev/null +++ b/ssh/.ssh/config @@ -0,0 +1 @@ +AddKeysToAgent yes diff --git a/zsh/.zshrc b/zsh/.zshrc index 334d89d..8543329 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -31,6 +31,8 @@ export LESSHISTFILE="/dev/null" #set the w3m homepage export WWW_HOME="duckduckgo.com/lite/" + #set ssh-agent to play nice with systemd. + export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" #web_search from terminal function web_search() {