[X2Go-User] Global ssh-agent

Dirk Deimeke dirk at deimeke.net
Tue Nov 24 15:06:33 CET 2015


On 2015-11-24 13:10, Dmitry Bely wrote:

Hi Dmitry,

> This way SSH_AUTH_SOCK is correct but SSH_AGENT_PID is surprisingly
> unset somethere. Any idea how to fix that?

the PID is set via eval $(ssh-agent).

This is what I do:

[[ -s $HOME/.ssh-agent ]] || ssh-agent -s > $HOME/.ssh-agent
source $HOME/.ssh-agent 2>&1 >/dev/null

if [[ -z "$SSH_AGENT_PID" ]] || ! ps -fp "$SSH_AGENT_PID" | grep -q 
ssh-agent; then
     ssh-agent -s > $HOME/.ssh-agent 2>&1 >/dev/null
     source $HOME/.ssh-agent 2>&1 >/dev/null
fi

if ! ssh-add -l | grep -q id_dsa; then
     ssh-add $HOME/.ssh/id_dsa
fi

Cheers

Dirk

-- 
http://d5e.org/


More information about the x2go-user mailing list