mirror of
https://github.com/bertptrs/vimconfig.git
synced 2025-12-25 20:40:32 +01:00
Systemd-based ssh agent management.
This commit is contained in:
10
systemd/.config/systemd/user/ssh-agent.service
Normal file
10
systemd/.config/systemd/user/ssh-agent.service
Normal file
@@ -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
|
||||
@@ -8,6 +8,11 @@ if [[ -o interactive ]] && [[ -n $SSH_TTY ]] && [[ -z $TMUX ]] && type tmux &> /
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# Check for service-managed keyring
|
||||
if [[-z $SSH_AUTH_SOCK ]] && [[ -S $XDG_RUNTIME_DIR/ssh-agent.socket ]]; then
|
||||
export SSH_AUTH_SOCKET="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||
fi
|
||||
|
||||
#######################
|
||||
# Initialize keyboard #
|
||||
#######################
|
||||
|
||||
Reference in New Issue
Block a user