Use KeePassXC as the ssh-agent key provider

This commit is contained in:
Felix Buehler 2019-06-26 19:39:45 +02:00
parent f4e2316a1a
commit 56936808d4
2 changed files with 5 additions and 10 deletions

View file

@ -1,12 +1,7 @@
#!/bin/sh
# array to process, either folders or directories for recursive processing
KEYPATHS+=("$HOME/.ssh")
#!/usr/bin/env bash
# Assert an ssh-agent (which is empty at the beginning)
if command -v keychain 2>&1 >/dev/null; then
eval \
"$(find "${KEYPATHS[@]}" -type f -name '*.pub' 2>/dev/null \
| sed 's/.pub$//' \
| xargs keychain -q --nogui --agents ssh --timeout 600 --eval)"
eval $(keychain -q --nogui --agents ssh --timeout 600 --eval)
fi
unset KEYPATHS