I read and followed some online documentation on how to set up a ssh-agent so that I don't need to type in password every time I ssh to a remote machine.
However, with the help of ssh-agent, I still need to do
ssh-add every time I restart the shell. The
ssh-add then asks me to enter the passphrase to unlock the private key.
Enter passphrase for key '/home/xx/.ssh/id_rsa':
Instead of typing in my password for the remote machine, I am asked to type in the password for the private key. It's like stepping out of a purgatory and found myself in a hell afterwards. It looks like the id_rsa is only temporarily added to the ssh-agent in a session, because every time I log in and type
ssh-add -l. I get:
The agent has no identities.
May I ask how permanently store the key (id_rsa) in ssh-agent? Thanks
EDIT: this is what I did with
ssh-agent. I appended the following block into
if [ -z "$SSH_AUTH_SOCK" -a -x "SSHAGENT" ]; then
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0