SSH public key Without Password Authentication

Source: Internet
Author: User

SSH public key Without Password Authentication 1) generate a password for 1ssh-keygen-t rsa-p' on the master host and press Enter. The command is generated in the user's main directory by default. ssh directory. You have two key pair files: id_rsa and id_rsa.pub 1 [master @ hadoop ~] $ Ll. ssh/2-rw -------. 1 master 1675 Jun 3 id_rsa3-rw-r -- r --. 1 master 402 Jun 3 id_rsa.pub then configure the following on the master node and append id_rsa.pub to the authorized key. 1cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys thought this would be done, and it was found that the command ssh localhost still requires a password. After a long time, I finally found the cause and found the server to modify the SSH configuration file "/etc/ssh/sshd_config". Modify the following content (remove the preceding comment) 1 RSAAuthentication yes # enable RSA Authentication 2 PubkeyAuthentication yes # enable public key/private key pair authentication method 3 AuthorizedKeysFile. ssh/authorized_keys # After setting the public key file path (the same as the file generated above), remember to restart SSH service 1 service sshd restart to re-verify ssh localhost, the same principle applies when logging on to other machines remotely without a password. You only need to upload the id_rsa.pub generated by the local machine to other servers for the same operation.

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.