From 0d562c1e2a67205b0e31fd4f589a01cc2c40878e Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 7 Mar 2019 23:50:46 +0000 Subject: [PATCH] etc/profile.d/gpg.sh --- etc/profile.d/gpg.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/profile.d/gpg.sh b/etc/profile.d/gpg.sh index 51be8815..6568f841 100644 --- a/etc/profile.d/gpg.sh +++ b/etc/profile.d/gpg.sh @@ -1,9 +1,9 @@ which gpg >/dev/null 2>&1 || return export GPG_TTY=$(tty) -gpg_import_host() { +gpg_import_ssh() { local usage="gpg_import_host HOST" local host=${1:?$usage} local tmp="/tmp/gpg_import_host.$USER" - ssh -t "$host" 'GPG_TTY=$(tty) gpg --armor --export-secret-keys -o "'$tmp'"' - ssh "$host" 'cat "'$tmp'" && rm "'$tmp'"' | gpg --import --allow-secret-key-import ~/ + ssh -t "$host" 'install -m 600 /dev/null "'$tmp'" && GPG_TTY=$(tty) gpg --armor --export-secret-keys -o "'$tmp'"' + ssh "$host" 'cat "'$tmp'" && rm "'$tmp'"' | gpg --import --allow-secret-key-import } -- 2.47.3