Monday, April 2, 2007

Linux: how to password-less ssh

If you log in some severs by ssh frequently, you may not like to input your password every time, why not set up password-less ssh? Okay, let me to classify some words:

  • client: the computer where you are right now.
  • server: the computer into which you like to log
The procedure as follows:

1. Key pair generation on client.

ssh-keygen -t rsa
(don't input any passphrase when you are required to input)

Thus you get two files under ~/.ssh (private key file: id_rsa and the public key: id_rsa.pub)

2.Copy the public key file to server (under the directory: ~/.ssh) and append it to the file authorized_keys. For secruity, do
chmod 600 authorized_keys

3.Okay.

More detailed and accurate descriptions are available here.






No comments:

Locations of visitors to this page