Add ssh-agent service and ssh config

Add a systemd user service to start the ssh-agent and add an ssh
config to automatically add ssh identities to the agent when they
are used (otherwise we have to add them manually). I will see how
this works out.

See: https://wiki.archlinux.org/title/SSH_keys#SSH_agents
This commit is contained in:
2022-08-12 16:23:06 -07:00
parent afa622369b
commit f1b55c6be9
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# From: https://wiki.archlinux.org/title/SSH_keys#SSH_agents
[Unit]
Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
# DISPLAY required for ssh-askpass to work
Environment=DISPLAY=:0
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target

1
dotfiles/ssh/config Normal file
View File

@ -0,0 +1 @@
AddKeysToAgent yes