SSH Login Without Password (password-free logon through SSH)

Source: Internet
Author: User
1. Preface

This article briefly introduces how to use SSH for password-free login. All the operations are completed in UNIX.

2. Principles

Implemented through public key encryption and Private Key decryption.

The User Machine sub-stores the private key and the remote machine sub-stores the corresponding public key.

  1. The remote host uses the public key to encrypt a piece of text for the user.
  2. The user's machine uses the private key to decrypt and obtain the "text", which is then sent to the remote machine in plaintext format.
  3. If the text information received by the remote host is consistent with the text information, the user is trusted, that is, the user is a real user.
3. Specific operations
  1. First, log on to the remote host through SSH, and name it Dev. (SSH yansong @ Dev, and then enter the password to log on)
  2. Cd ~ & CD. Ssh // enter the personal environment and try to enter the. Ssh directory
  3. If the. Ssh directory does not exist, create it (mkdir. Ssh)
  4. Ls // check whether the id_rsa and id_rsa.pub files exist in the. Ssh directory.
  5. If the preceding two files do not exist, create them (enter ssh-keygen-t rsa, press enter, and press Enter)
  6. Cat id_rsa.pub> authorized_keys // copy the public key to the location where the verification key file is stored.
  7. Chmod 600 authoried_keys // RW -------
  8. SCP yansong @ Dev:. Ssh/id_rsa *~ //. Ssh // copy id_rsa and id_rsa.pub to the corresponding ~ /. Ssh directory
4. Post

The above content may be inappropriate. If not, please correct me.

5. Reference

SSH Login Without Password

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.