There are two methods of authentication when using ssh. Both methods prevent your password from being transmitted across the network in cleartext form and will encrypt remote login connections.
The first is to just use the applications and rely on your standard password to authenticate you. This is the simpler of the two methods and still encrypts the password.
The second method involves the use of an RSA public/private key pair. This is a more secure method because it requires you to have possession of a key file and knowledge of your password to authenticate yourself. With this method, public-key cryptographic methods are used for authentication and no password is transmitted across the network, cleartext or encrypted. It is not necessary to fully understand public-key to use ssh, but for more information click on the links in this paragraph.
If you want to use the first method, then you can skip the rest of this document and move onto the other topics, such as logging into a remote host. To use the second method of authentication you need to follow the steps in the rest of this document to generate your personal key pair before using ssh as described in the other documents.
Step 1 is split into different sections for different host types. Choose one:
Login to the host from which you will want to initiate remote connections. From a shell prompt type:
ssh-keygenAfter a few moments, a key will be generated. You will then be asked for a file in which to save the key. Just press <ENTER> to accept the default.
You will then be asked for a passphrase. Unlike your normal login passwords, this phrase can be of arbitrary length. You should not choose the same password you use for normal logins as this reduces the security. According to the Ssh documention, "Good passphrases are 10-30 characters long and are not simple sentences or otherwise easily guessable."
The passphrase can be changed later at anytime you want, but if you forget it there is no way to recover it or reset it and you must generate a new key from the very beginning.
When you have entered your passphrase twice, you will be given some information about where your identification and public key have been saved. Make a note of the public key file (it will probably be ~/.ssh/identity.pub).
You can now skip down to step 2.
You can now skip down to step 2.
When you isntall the F-Secure SSH software by Data Fellows (see the Obtaining Clients page), then it will generate the key automatically the first time you start up the software.
To complete the process, the contents of the identity.pub file (i.e. your public key) must be copied to every host that you wish to be able to connect to. It's contents must be appended to the following file in the ~/.ssh/ directory:
authorized_keysFirst copy the identity.pub to the remote host and put it in the ~/.ssh/ directory. To copy the file to these hosts you should use the secure means with ssh (using normal password authentication). Instructions for using ssh to do this can be found on the Transferring Files page.
Once the file is there, login to the remote host using your normal means or using ssh (with the normal password authentication) If the .ssh directory already exists (which it will if you generated a key on your Unix acount) then change into the .ssh directory:
cd .sshIf the .ssh directory does not yet exist, first create it with this command (and then change into this directory):
mkdir .sshThen use the cat command to append the contents of the identity.pub to authorized_keys:
cat identity.pub >> authorized_keysAlternatively, if you know that this is the first key to go into authorized_keys, you could just make a duplicate of identity.pub on the local machine, rename it to authorized_key and then copy that file over.
This entire process (Steps 1 & 2) should be completed for every host that you wish to initiate connections from. The exception here is if the hosts are Unix hosts on a cluster for which you have a common home directory. Alternatively (and less securely) you could copy the identity file along with the public key file to all hosts. This would give you a single key pair to work with.