From 13702a21e76ed9f60a46039c74771a1b0f8f6e83 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 11 Sep 2020 13:06:18 +0200 Subject: [PATCH] [FIX][SHELL] Inherit keychain's ssh-agent from env I also use this opportunity to make it use a different directory, to avoid polluting my $HOME. --- shell/.profile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell/.profile b/shell/.profile index 816165d..ca1160a 100644 --- a/shell/.profile +++ b/shell/.profile @@ -45,6 +45,9 @@ if { [ -n "$BASH_VERSION" ] && shopt -q login_shell; } || # Use this path for `remind` calendar export DOTREMINDERS="$HOME/.config/remind/reminders.rem" + + # Use my ssh-agent service's socket + export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" elif { [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ] ; } && [[ $- == *i* ]]; then # When interactive, deactivate terminal freezes stty -ixon @@ -54,7 +57,7 @@ fi unset SSH_ASKPASS # Use keychain to handle ssh-agent, in interactive shell too -eval "$(keychain --eval id_rsa --eval shared_rsa --quiet)" +eval "$(keychain --dir ~/.cache/keychain --inherit any-once --eval id_rsa --eval shared_rsa --quiet)" # Use my localrc script to automatically source/unsource local configurations source ~/.scripts/localrc