From 0f0043ac08c33aacc231aba62ccb8220d787b990 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 5 Oct 2016 00:10:48 +0100 Subject: [PATCH] Improve SSH-agent session management for chained connections --- .profile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.profile b/.profile index 7ca5725..9ed0e9f 100644 --- a/.profile +++ b/.profile @@ -21,7 +21,9 @@ if ! [ -z $DISPLAY ] && which autocutsel &>/dev/null; then autocutsel -selection PRIMARY -fork & fi +# Start an ssh-agent if [ -z $SSH_AUTH_SOCK ]; then eval `ssh-agent` - ssh-add fi +# Always add SSH key to the running agent; local or remote +ssh-add