Semlab : Muri : System : Howto : SSH for transparent login

This document describes how to use SSH to get secure and encrypted access to our Unix servers, for both login and file transfer, without ever having to type your password. (Note on why this is OK.)
Overview: here we'll 1) install the SSH client software for Windows, 2) generate a cryptographic key pair used for authentication, and 3) copy the key onto your Windows box so you can use it for login.

If you're not using Windows, you may still find step 2) of this useful as it will also enable transparent logins between Unix machines in the same cluster, so you can hop between machines without having to type your password each time, and if you also follow step 3) you can use this between Unix machines in different clusters (i.e., between the CSLI machines and the Leland workstations, etc.).

  1. Install the SSH client software for Windows

    What you need for our purposes (getting CVS to work) is just a command-line SSH client, but a command-line SCP client is also handy, and a graphical SSH/terminal client is also useful, so I recommend you install this version of TeraTerm SSH put together by the Stanford Graphics Laboratory, which includes all of the above.

  2. Generate a public/private key pair used for authentication

    Here is where we actually generate the cryptographic key, unique to you, that you'll be using instead of a password to prove you are you.

    Side note: this keypair has the side effect of letting you type "ssh hugin", "ssh turing", etc. to log in to a different machine in the CSLI cluster without having to type your password. What actually happens when you do this is as follows: the FROM computer (where you're already logged in and executing this command) sends the "identity" file to the TO computer, where you want to log in. The TO computer has a copy of "authorized.keys", and (via the math behind public-key cryptography) it can verify that the identity key given machines the authorized key. Then it lets you log in. The upshot is you can jump *from* any computer containing "identity" in the right spot (~/.ssh/identity on Unix) *to* any computer containing "authorized_keys" in the right spot (~/.ssh/authorized_keys) without typing your password. Since all the computers in the CSLI cluster give you the same view of your home directory, once you've set this up on hugin as above it works for all of them.

    If you want to be able to log in to other Unix computers with the same key, for example the Leland workstations, it suffices for them to have a copy of authorized_keys in the same spot (~/.ssh/), and for the reverse direction they need ~/.ssh/identity in the same place.

    Since the file "identity" is now effectively your password (you can still use your password instead, but this file will let anyone who has it log in as you without your password), keep it safe. On Unix, both it and the ~/.ssh directory should have 0700 permissions. ("chmod 700 ~/.ssh" to be safe.)

  3. Copy the key to your Windows machine


Note: why it's OK to set up passwordless logins, why you'd want to do this, and why SSH is a better option for this than other tools. First, why you'd want to: it's convenient, makes it very easy to log in from your Windows machine to the Unix machines as well as hopping from one Unix machine to another without having to reauthenticate each time, and most importantly for our purposes here, facilitates the use of SSH as the file transfer mechanism for CVS. Second, why it's still secure: you will generate a cryptographic key which will substitute for your password, and you will still need to prevent this key (which is much harder to guess or crack than any conceivable password) on each login. You do still need to keep this key safe; I recommend storing it only on systems with secure multiuser file systems (Unix, or NT/2000 using NTFS). Third, why SSH is better than alternatives such as rlogin: it's much harder to fool (because of the cryptographic key) than these weaker forms of authentication.