How to install public keys with open-ssh


First read PC Setup Instructions on how to download and install ssh (secure remote  shell) and pscp (ssh-based file copy utility). The instructions are based on open-ssh running under standard Windows OS (e.g. Windows 2000 or XP), not Cygwin!


Next step is to generate a public key file on your client PC and copy it to the remote server where you wish to be able to login without giving password.

 

  1. Make sure you have the directory c:\.ssh. It is generated the first time you use ssh. Create it if necessary.
  2. Go to C:\.ssh and issue there the command
       ssh-keygen –t rsa

The system will prompt you for a file in which to save the public key. Answer: identity. The system will also ask you for a passphrase. Answer with empty line.

  1. Copy the file identity.pub to a temporary file, e.g. tempkey, on the remote server. For example:
       pscp identity.pub me@hamberg.it.uu.se:.ssh/tempkey
  2. Login on the remote server. Go to folder ~/.ssh and append there the temporary file to the file authorized_keys. Make a backup copy of authorized_keys first is it exists. For example:
      ssh me@hamberg.it.uu.se
      cd .ssh
      cp authorized_keys authorized_keys.old
      cat tempkey >> authorized_keys
  3. Test the connection by logging in from the PC, e.g.
      ssh me@hamberg.it.uu.se

If it works you should be able to login without entering any password.