Created
January 4, 2018 05:19
-
-
Save vancluever/e8e38a3255ddeeb3149109519f42aad5 to your computer and use it in GitHub Desktop.
SSH agent systemd service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=OpenSSH Agent | |
[Service] | |
Type=simple | |
Environment=SSH_AUTH_SOCK="%t/ssh-agent.socket" | |
ExecStart=/usr/bin/ssh-agent -D -t 14400 -a "${SSH_AUTH_SOCK}" | |
[Install] | |
WantedBy=default.target |
how to access SSH_AUTH_SOCK from a system unit file run as a User=?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This goes into
${HOME}/.config/systemd/user/ssh-agent.service
.After this is done, you can run
systemctl --user daemon-reload
to make it visible. Then, runsystemctl --user enable ssh-agent.service
to enable it, and it will start on the next login (or you can just start it yourself).