Add this to your ~/.bashrc
, then logoutlog out and back in to take effect.
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent`
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l > /dev/null || ssh-add
This should only prompt for a password the first time you loginlog in after each reboot. It will keep reusing the same ssh-agent
as long as it staysit's running.