Pre-requisites:
First, assuming you have a user on both machines, notroot, while logged in as that user, generate your ssh-key:
notroot@here:/home/notroot$ ssh-keygen
Generating public/private rsa key pair.
You will be asked where to save it, the default location should be fine:
Enter file in which to save the key (/home/notroot/.ssh/id_rsa):
Created directory '/home/notroot/.ssh'.
Then you'll be asked for a passphrase. Now, you might want to know what the use of doing this is if you're just going to need to enter a password again. It's not a password. It's a passphrase. It's something you know and the key is something you have, both of which make the overall security a little better. A non-blank passphrase, coupled with an SSH server on the remote side that doesn't accept just a password, makes for a more secure SSH system. But, of course that wouldn't be easy. So to be easy, leave this blank:
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/notroot/.ssh/id_rsa.
Your public key has been saved in /home/notroot/.ssh/id_rsa.pub.
The key fingerprint is:
12:ab:34:cd:56:ef:78:gh:90:ij:12:kl:34:mn:56:op notroot@here
The key's randomart image is:
+--[ RSA 2048]----+
|:-)(-: |
|8-DD-8 |
|@-| B-> |
|00 |
|--- |
|? |
| |
| |
| |
+-----------------+
OK, you've got the key, now what? Well, for awhile, there was a bunch of hassle in moving the key and copying the username and whatnot all over creation in the remote directories and other such hassle. Believe me, it was a pain. Now? Simple:
notroot@here:~/.ssh$ ssh-copy-id -i id_rsa.pub notroot@there
notroot@there's password:
Now try logging into the machine, with "ssh 'notroot@there'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
Voila! Now, to test it, try to ssh to the box:
notroot@here:~/.ssh$ ssh there
Linux 2.6.21.5-smp.
Tomorrow will be canceled due to lack of interest.
notroot@there:~$
Perfect.
