ssh: add all SSH keys in ssh-agent on start

This commit is contained in:
Vincent Bernat 2020-11-22 10:45:20 +01:00
parent 3826c390b5
commit 057c3daf07
2 changed files with 12 additions and 0 deletions

10
bin/ssh-add Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
cd ~
ssh-add $(
sed -n 's/^ *IdentityFile ~\/\([^ ]*\).*/\1/p' ~/.ssh/config \
| sort \
| uniq
)
ssh-add -l

View file

@ -1,9 +1,11 @@
[Unit]
Description=Miscellaneous settings for X11 on %I
PartOf=graphical-session@%i.target
After=ssh-agent.service
[Service]
Environment=DISPLAY=%I
ExecStart=/usr/bin/xset -b
ExecStart=%h/.config/awesome/bin/ssh-add
Type=oneshot
RemainAfterExit=false