Originally posted by johnnydangerous
well if you may pls tell about ssh-agent and ssh-add
the ssh-agent takes care of your keys for you once you add it and if necessary entered the pass phrase. after this you only need to connect via ssh and no further pass phrase is asked.
you can run the agent by
(could be ssh-agent2)
instead of /bin/bash you can use your shell you feel comfortable with,
personally I invoke bash with a different .bashrc so I know when I am in a shell running the agent
after the agent is running you run ssh-add
(ssh-add2) to add the keys to the agent, it will ask you the pass phrase for any key loaded, there is a way to specify which key (identity) you want to load, but lets keep things simple.
if you now establish a ssh connection you should connect without any further authentication.
to be on the secure side you can unload the keys out of the agent by running
also it is possible to lock the agent by running
it can be unlocked using
I hope this helps.
lists all loaded keys.
It is good practice to unload the keys before quiting the agent with exit.
Here is my .bashrc which I use with ssh-agent
alias keys='ssh-add2 -l'
alias keysOff='ssh-add2 -D"
alias quit='ssh-add2 -D;exit'
I simply invoke it by running
ssh-agent /bin/bash -rcfile .bashsshrc
Please note that the use of ssh-agent(2),ssh-add(2) and ssh(2) depends of your version of ssh (OpenSSH or SSH2)