From 876f42658124379d3b2a8756f9169fc47839f8be Mon Sep 17 00:00:00 2001 From: Mathieu Chataigner Date: Tue, 8 Mar 2016 17:14:47 +0100 Subject: [PATCH] Update ssh module for multi session hosts create ssh_agent_env with current user id in file name to avoid collisions with other users create ssh_agent_sock with current user id in file name to avoid collisions with other users --- modules/ssh/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index f632328d..8caac92c 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -14,10 +14,10 @@ fi _ssh_dir="$HOME/.ssh" # Set the path to the environment file if not set by another module. -_ssh_agent_env="${_ssh_agent_env:-${TMPDIR:-/tmp}/ssh-agent.env}" +_ssh_agent_env="${_ssh_agent_env:-${TMPDIR:-/tmp}/ssh-agent.env.$UID}" # Set the path to the persistent authentication socket. -_ssh_agent_sock="${TMPDIR:-/tmp}/ssh-agent.sock" +_ssh_agent_sock="${TMPDIR:-/tmp}/ssh-agent.sock.$UID" # Start ssh-agent if not started. if [[ ! -S "$SSH_AUTH_SOCK" ]]; then