Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Created August 11, 2023 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdamjan/4640ec2f544e115c963fa6f267a9e867 to your computer and use it in GitHub Desktop.
Save gdamjan/4640ec2f544e115c963fa6f267a9e867 to your computer and use it in GitHub Desktop.
ssh-agent.service
[Unit]
Description=SSH key agent
Documentation=man:ssh-agent(1)
# Configure ssh to use the socket:
# cat ~/.ssh/config
# Host *
# IdentityAgent ${XDG_RUNTIME_DIR}/ssh-agent.socket
# ...
#
# Another option is to set the SSH_AUTH_SOCK env var to "$XDG_RUNTIME/ssh-agent.socket"
# probably via ~/.config/environment.d/
#
# cat ~/.config/environment.d/ssh.conf
# SSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/ssh-agent.socket
#
[Service]
Type=simple
ExecStart=/usr/bin/ssh-agent -D -a %t/ssh-agent.socket
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment