Configure SSH trust between Linux (SSH password-free login)

Source: Internet
Author: User
Tags ssh server ssh config ssh config file

In order to simplify the SSH process, the use of the certificate method, the SSH login to avoid the need to enter the account password process, the specific operation is as follows:

One, on the machine where the SSH server

1. Log in as root, change the SSH config file/etc/ssh/sshd_config, and remove the comments from the following configuration

rsaauthentication Yes #启用rsa认证PubkeyAuthentication Yes #启用公钥私钥配对认证方式AuthorizedKeysFile. ssh/authorized_keys #公钥文件路径

2. Restart the SSH service

[[email protected]/] #systemctl restart sshd  // restart SSH service

Second, on the client machine

1. Generate public key private key pair

[[email protected]/]#ssh-keygen -t RSA

All the way to the default carriage return, the system generates ID_RSA, id_rsa.pub under/root/.ssh

2, send the id_rsa.pub to the server machine

[[email protected]/]#ssh-copy-ID -i/root/. SSH 192.168. 1.20 #server IP

3. Verification

[[email protected]/]#ssh192.168. 1.20 #server IP

Configure SSH trust between Linux (SSH password-free login)

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.