summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bash_profile7
-rw-r--r--.ssh/config1
2 files changed, 8 insertions, 0 deletions
diff --git a/.bash_profile b/.bash_profile
index 3e575aa..f9b3910 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -34,6 +34,8 @@ export GREP_OPTIONS="--color=auto"
export PS1="[\h]: \W \$ "
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
+
+# ==== GPG Config
GPG_TTY=$(tty)
export GPG_TTY
unset SSH_AGENT_PID
@@ -42,6 +44,11 @@ if [ -z "$SSH_AUTH_SOCK" ]; then
SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
export SSH_AUTH_SOCK
fi
+# Clean up sockets on logout to avoid gpg warning
+# Warning: remote port forwarding failed for listen path
+if [ -n "$SSH_CONNECTION" ]; then
+ trap 'rm -f /run/user/$(id -u)/gnupg/S.* 2>/dev/null' EXIT
+fi
# ==== Shell Opts
shopt -s checkwinsize # check the window size after each command and, if necessary, update LINES/COLUMNS
diff --git a/.ssh/config b/.ssh/config
index 9c118da..465e887 100644
--- a/.ssh/config
+++ b/.ssh/config
@@ -10,6 +10,7 @@ Host *.local
Port 39901
ForwardAgent yes
StreamLocalBindUnlink yes
+ RemoteForward /run/user/1000/gnupg/S.gpg-agent %d/.gnupg/S.gpg-agent
# ssh -v kex: algorithm: [email protected]
# post-quantum algorithm hangs and fails to exchange keys on ubuntu.