From 490745508a111f1eb2a476b40bf11ef1b16fb87c Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 22 Aug 2024 18:44:11 +0200 Subject: [PATCH] ssh-agent: Add lifetime for added keys --- splitAUTHENTICATION | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/splitAUTHENTICATION b/splitAUTHENTICATION index 08acaed..defa1d0 100644 --- a/splitAUTHENTICATION +++ b/splitAUTHENTICATION @@ -15,8 +15,10 @@ # If a session already exists {{{ #if-shell -b 'tmux has-session' { - ## Temp window to ensure a ssh-agent is running - #new-window -nAuth 'ssh-agent -a "${SSH_AGENT_SOCK}" ; logout' + ## Temp window to ensure a ssh-agent is running with + ## * specific SOCKET path + ## * life duration + #new-window -nSSH-Agent 'ssh-agent -a "${SSH_AGENT_SOCK}" -t 4h ; logout' ## Window for authentication tools #display-message "Create a new window for Authentication" @@ -32,8 +34,10 @@ if-shell -b 'test -z $TMUX' { ## Attach the last session attach-session - ## Temp window to ensure a ssh-agent is running - new-window -nSSH-Agent 'ssh-agent -a "${SSH_AGENT_SOCK}" ; logout' + ## Temp window to ensure a ssh-agent is running with + ## * specific SOCKET path + ## * life duration + new-window -nSSH-Agent 'ssh-agent -a "${SSH_AGENT_SOCK}" -t 4h ; logout' ## Window for authentication tools display-message "Create a new window for Authentication" @@ -46,8 +50,10 @@ if-shell -b 'test -z $TMUX' { # }}} # If file was source from a running tmux {{{ if-shell -b 'test -n $TMUX' { - ## Temp window to ensure a ssh-agent is running - new-window -nSSH-Agent 'ssh-agent -a "${SSH_AGENT_SOCK}" ; logout' + ## Temp window to ensure a ssh-agent is running with + ## * specific SOCKET path + ## * life duration + new-window -nSSH-Agent 'ssh-agent -a "${SSH_AGENT_SOCK}" -t 4h ; logout' ## Window for authentication tools display-message "Create a new window for Authentication"