Using ssh-agent
Using ssh-agent with ssh is handy. I got tired of typing the passphrase in for my key. I love the .profile code to automate starting ssh-agent.
If you want to, say, put it in your .profile, then you might try the following setup. In my .bash_profile, I have
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
Using ssh-agent with ssh is handy. I got tired of typing the passphrase in for my key. I love the .profile code to automate starting ssh-agent.
If you want to, say, put it in your .profile, then you might try the following setup. In my .bash_profile, I have
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