mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-20 17:15:41 +02:00
ssh-agent: on start, import all SSH keys
This commit is contained in:
parent
adfce79ac2
commit
370270b1ca
2 changed files with 13 additions and 2 deletions
10
bin/ssh-add
Executable file
10
bin/ssh-add
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
export SSH_ASKPASS=/usr/bin/ssh-askpass
|
||||
ssh-add -l > /dev/null || ssh-add $(
|
||||
sed -n 's/^ *IdentityFile ~\/\([^ ]*\).*/\1/p' ~/.ssh/config ~/.ssh/*/config \
|
||||
| sort \
|
||||
| uniq
|
||||
)
|
||||
|
||||
ssh-add -l
|
|
@ -4,9 +4,10 @@ Wants=dbus.socket
|
|||
After=dbus.socket
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Type=forking
|
||||
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
|
||||
ExecStartPre=/usr/bin/dbus-update-activation-environment --systemd SSH_AUTH_SOCK
|
||||
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
|
||||
ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK
|
||||
ExecStartPost=%h/.config/i3/bin/ssh-add
|
||||
ExecStopPost=/usr/bin/dbus-update-activation-environment --systemd SSH_AUTH_SOCK=
|
||||
Restart=always
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue