Saturday, March 13, 2010

SSH: Login Without Password


Just have this in mind:

If you want to login from machine F to machine T through SSH, the "public key" of F should be in "authorized_keys2" file in T.

You need to have static IP/host-name on both machines for this to work

In machine F:

To create a public key for F, use the command: ssh-keygen -t rsa.
When prompted for paraphrase just click enter.

The created public key will be ~/.ssh/id_rsa.pub.

In machine T:

Copy the contents of this (id_rsa.pub) file to ~/.ssh/authorized_keys2 file in machine T.
If the folder .ssh does not exist, create it.
If the file authorized_keys2 does not exist, create it.

That's it!


No comments: