Configure SSH key authentication

Source: Internet
Author: User

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.