How to set ssh-agent to run automatically
#~/.bash_profile
if [ “$SSH_AUTH_SOCK”=”” -a -x /usr/bin/ssh-agent ]; then
eval `/usr/bin/ssh-agent`
fi
—
# ~/.bash_logout
if [ “$SSH_AGENT_PID” != “” -a -x /usr/bin/ssh-agent ]; then
/usr/bin/ssh-agent -k
fi
—
ssh-add