Setting up a trusted ssh connection

This procedure will configure ssh to allow logging into a host without needing a password.

You only have to do this once.

  1. Ensure that ssh is installed on both hosts.
  2. On both hosts, create a directory named .ssh
  3. On both hosts, run
  4. ssh-keygen -t dsa

  5. When it asks for a passphrase, just hit the return.
  6. Go into the .ssh directory of your home machine. Among other things, you will see a file named id_dsa.pub. This is the ssh key you will give to the remote host.
  7. Log into the remote host, go into the .ssh directory and create a text file named
  8. authorized_keys

  9. containing the text from the id_dsa.pub file in the .ssh on your home machine.
  10. Now, leave the remote host and type
  11. ssh remote_hostname

  12. and answer Y to the question of whether this remote host is acceptable.
  13. After that, you should be able to log into the remote host anytime you want, just by typing
  14. ssh remote_hostname

without any further user interaction (i.e. without entering a password). In addition, such connections will automatically forward X-window sessions, so you can run X-windows applications on the remote host and have all of the GUI appear on your home machine. All communication will be encrypted via high-quality encryption algorithms.

Advertisements