git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHarald Pfeiffer <coding _ lirion.de> 2022-03-24 09:25:00 +0100
committerHarald Pfeiffer <coding _ lirion.de> 2022-03-24 09:25:00 +0100
commited38fa7e33af9162974e940e797d4eb1f11e3d42 (patch)
tree21e8a532e53e7576c90b24bc8b57ff78800c6634 /bin
parent5da59c47bdcdd5f68e1a9429f42ead2e60a5a8dc (diff)
downloaddotfiles-ed38fa7e33af9162974e940e797d4eb1f11e3d42.tar.bz2
gnupg forwarding now working
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ssh-with-gpg7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/ssh-with-gpg b/bin/ssh-with-gpg
index aac1651..7ca0d67 100755
--- a/bin/ssh-with-gpg
+++ b/bin/ssh-with-gpg
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
+# For this to work, you also need to import the public key of any private key you want to use
+# in the target server's pubring first.
+
if [ -z "$1" ];then
printf "USAGE: %b TARGET [OPTIONS...]\\n" "$(basename "$0")" >&2
exit 1
@@ -8,10 +11,10 @@ fi
TGT="$1"
REMUID="$(ssh "$TGT" "id -u")"
-ssh "$TGT" 'rm -f /run/user/$(id -u)/gnupg/S.dirmngr'
+ssh "$TGT" 'killall gpg-agent 2>/dev/null;rm -f /run/user/$(id -u)/gnupg/S.*'
if [ -z "$REMUID" ];then
printf "Cannot fetch user id from %b.\\n" "$TGT" >&2
exit 2
fi
-ssh -R "/run/user/${REMUID}/gnupg/S.dirmngr":"/run/user/$(id -u)/gnupg/S.dirmngr" -o "StreamLocalBindUnlink=yes" "$TGT" "${@:2}"
+ssh -R "/run/user/${REMUID}/gnupg/S.gpg-agent":"/run/user/$(id -u)/gnupg/S.gpg-agent-extra" -o "StreamLocalBindUnlink=yes" "$TGT" "${@:2}"