Using Public/Private Key authentication also buys you convenience when you take advantage of ssh-agent and ssh-add. ssh-agent runs as a background process or parent process of your shell, and manages your keys for you so that you aren't prompted to enter your passphrase each time you make a connection. ssh-add is the program you use to add keys to the ssh-agent process and to view which keys ssh-agent is currently managing.
Not only is this method convenient, but some applications which require an rsh-style connection to a remote machine also require that no output be sent to standard output or standard error, and this includes prompting for a password or a passphrase. In such a situation, managing keys with ssh-agent is a necessity.
You'll be glad to notice, however, that from this point forward, both versions of the SSH programs operate identically, though they may produce slightly different output.
To begin an instance of your login shell under ssh-agent, simply enter:
ssh-agent $SHELL
Notice that you are running another shell on top of your already running shell, and you can exit from this one at any time by typing ``exit'' or hitting CTRL-D.
If SSH2 is the default on your system (as it is on Hunter Creech) and you need to connect with systems running SSH1, or if SSH2 fails for some reason, you can start ssh-agent to accept SSH1-style keys as well by invoking it with the ``-1 '' (that's the numeral ``one'') option:
ssh-agent $SHELL -1
To add the local host's private key to ssh-agent, simply execute ssh-add and enter your passphrase when prompted. Then you can view the list of identities which ssh-agent is currently managing by executing ``ssh-add -l '' (that's the letter ``ell''):
mbland@defender /home/student/mbland -> ssh-add Adding identity: /home/student/mbland/.ssh2/id_dsa_1024_defender.pub Need passphrase for /home/student/mbland/.ssh2/id_dsa_1024_defender.pub (1024-bit dsa, mbland@defender, Sun Apr 30 2000 21:39:13). Enter passphrase: mbland@defender /home/student/mbland -> ssh-add -l Listing identities. The authorization agent has one key: id_dsa_1024_defender: 1024-bit dsa, mbland@defender, Sun Apr 30 2000 21:39:13
If you invoked ssh-agent with the ``-1'' option, you can use ssh-add1 to add SSH1-style keys as well, and you can execute ``ssh-add1 -l'' to view the SSH1-style keys currently loaded.
You are now free to roam uninhibited between any and all hosts which have your local host's public key information:
mbland@defender /home/student/mbland -> ssh-add -l Listing identities. The authorization agent has one key: id_dsa_1024_defender: 1024-bit dsa, mbland@defender, Sun Apr 30 2000 21:39:13 mbland@defender /home/student/mbland -> ssh cambria Last login: Sun Apr 30 2000 23:27:53 mbland@cambria /home/student/mbland ->