This article is somewhat out of date. Modern OpenSSH distro's include 'ssh-copy-id', a single command to transfer, and append one's key to the remote list ofauthenores keys.<p>So:<p>Step 1:<p><pre><code> ssh-genkey
</code></pre>
Step 2:<p><pre><code> ssh-copy-id user@host
</code></pre>
Done.
Some more SSH tips<p>1. Use SSH connection multiplexing<p>If you are connecting to same computer multiple times, this saves up quite a bit of time
<a href="http://www.revsys.com/writings/quicktips/ssh-faster-connections.html" rel="nofollow">http://www.revsys.com/writings/quicktips/ssh-faster-connecti...</a><p>2. Use autossh<p>For a persistent ssh connection (ex. for reverse tunnels)
<a href="http://www.debianadmin.com/autossh-automatically-restart-ssh-sessions-and-tunnels.html" rel="nofollow">http://www.debianadmin.com/autossh-automatically-restart-ssh...</a>
1) You should definitely create a passphrase for your private key (you should only be asked to unlock it once due to ssh-agent). Otherwise if someone gets hold of your private key they can login to any machine you have set up an authorized_keys entry on.<p>2) use ssh-copy-id to install your public key on a remote (and fix up the permissions on ~/.ssh etc. which for me is the #1 case of key based login not working).
He also flubbed using ssh-agent. Usually it is run from the login script once. You then do a ssh-add to add your identity to it. Once that is done you don't need to enter your password for that session anymore. You can even allow ssh on other systems to access your agent so you can ssh to another machine, ssh from that machine to a 3rd which will use your agent for the key info.<p>Never leave your key without a passphrase!<p>A good series of articles on ssh bt Brian Hatch can be found here - <a href="http://www.hackinglinuxexposed.com/articles/20021211.html" rel="nofollow">http://www.hackinglinuxexposed.com/articles/20021211.html</a>
I connect to remote machines several times in a typical workday, and this helps to save a bit of time. Furthermore, it allows some non-obvious behaviour, like closing the connection as soon as I did what I wanted. This avoids leaving a ssh session open in which you may erroneusly type a command intended for your local machine. An "svn up" on the wrong machine car ruin your day.
Isn't that a bit of a security issue? One machine in the network hacked, they are all gone? Then again, hacker's could just install keyloggers if they get hold of one machine. But it would be a bit more effort.