logo
Published on Input Jam (http://www.kleinfelter.com)

ssh Without a Password

By Kevin Kleinfelter
Created 2009-06-08 19:22

Here's how to set up password-free ssh.  Work out any problems with passworded ssh before proceeding.

  1. On the client machine, run "ssh-keygen -t rsa" (Note: Only do this if you don't have ssh without password connecting from this client to ANYWHERE.)
  2. Copy your id_rsa.pub (or your identity.pub, or whatever you've named your public key) to the server as ~/.ssh/authorized_keys.  If you already have an authorized_keys, append your id_rsa.pub to that file.
  3. On the server:
    1. chmod 600 .ssh
    2. chmod 600 .ssh/authorized_keys2
  4. On the client, run "ssh yourId@yourServer" and it should login without a password.

UPDATE: It looks like something changed in the cygwin ssh and/or keygen. The old keygen generated a file named "identity" and ssh worked fine with it. Now you need to rename the private key to be id_rsa (or you can "ln identity id_rsa").

Tested with Cygwin ssh client, Ubuntu 9, and a few flavors of Solaris. This is basic stuff, so it should work with all Unix-like systems.

How it works: The ssh client encrypts a string with your private key. The ssh server decrypts it with your public key. Only things encrypted with your private key can be decrypted with your public key, so the server knows you're you.


Source URL:
http://www.kleinfelter.com/node/170