This is an old configuration requirement that cannot be used any more. There are many articles on the Internet. The reason why I want to record it is that this configuration has some minor problems, so I should emphasize it here.
To configure the localhost (SSH client), log on with your user account and run the command ssh-keygen-t rsa:
$ Ssh-keygen-T RSA
Press enter three times in a row. Generally, the default output path is correct. passphrase is empty for automatic logon. Note: Because passphrase is empty, the generated private key must be absolutely forbidden from unauthorized access! Copy the generated id_rsa.pub file to the/home/username/. Ssh/directory of remotehost.
To configure the remotehost (SSH server), log on with the username account. Run the following command: $ mkdir. SSH
Change the. Ssh directory permission to 700 (very important !)
$ Chmod 700. SSH
Create the authorized_keys file in the. Ssh directory.
$ Cd. SSH
$ Umask 077
$ Cat id_rsa.pub> authorized_keys
Test SSH Automatic Logon
Refer:
Http://phoenix007.iteye.com/blog/709455
Http://www.sar4.com/2011/08/21/ssh%E5%AF%86%E9%92%A5%E5%AF%B9%E7%9A%84%E8%87%AA%E5%8A%A8%E7%99%BB%E5%BD%95.html
Http://www.xiaojb.com/archives/it/ssh-login.shtml
Https://wiki.archlinux.org/index.php/Using_SSH_Keys_ (% E7 % AE % 80% E4 % BD % 93% E4 % B8 % ad % E6 % 96% 87)
Http://www.linuxidc.com/Linux/2011-06/37539.htm