ssh-agent

05. August 2016 09:08

If you use bash and don’t have a ~/.bash_profile

touch ~/.bash_profile
chmod a+x ~/.bash_profile

Then add this to your existing or non existing bash_profile

SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
    eval `$SSHAGENT $SSHAGENTARGS`
    trap "kill $SSH_AGENT_PID" 0
fi

In order to add your ssh-key

ssh-add -l | grep "The agent has no identities" && ssh-add ~/.ssh/id_ecdsa