summaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-10-19 11:03:29 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-10-19 11:03:29 -0700
commitc3c7878c77000223cbe464a6d6596e01ca92f331 (patch)
tree3fb2b7f859767d7cb7cc6a13f1aa3c55884d67a1 /.bashrc
parent1ef1d5e2b41aa36461ee8ebab9c74536c7b8e1a9 (diff)
downloaddotfiles-c3c7878c77000223cbe464a6d6596e01ca92f331.tar.gz
add kill-remote-gpg to .bashrc
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc11
1 files changed, 11 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index 8a878728..3e277d3d 100644
--- a/.bashrc
+++ b/.bashrc
@@ -218,6 +218,17 @@ secs () {
echo 0
}
+# sometimes a remote SSH session cannot get at my forwarded SSH agent
+# because an unwanted instance of gpg-agent running on the remote host
+# gets in the way. this is a way to kill off that unwanted agent. we
+# also need to restart the multiplexed SSH connection to get agent
+# forwarding working again. I think this problem is mostly caused by
+# the fact that I use gnupg as my SSH agent
+kill-remote-gpg () {
+ ssh "$1" 'rm -f $XDG_RUNTIME_DIR/gnupg/*'
+ ssh -O exit "$1"
+}
+
# --- host-specific aliases/functions
# ftp-master.debian.org