Ssh password-free login-Establish a trust relationship with the server

Source: Internet
Author: User

Ssh password-free login-Establish a trust relationship with the server

Assume that the master machine A, B, and C needs to be established as the master machine A. You can directly access the master machine B and C through ssh without A password. The procedure is as follows:

Assume that you only use the user yimr to establish trust, use the yimr user to log on to host A and perform the following operations:

Generate public and private keys
Ssh-keygen-t rsa

Then, the id_rsa and id_rsa.pub files are generated under the/home/user/. ssh directory.

Copy the public key to the BC Node
Scp. ssh/id_rsa.pub B:/home/username/. ssh/A. pub
Go to the BC node and put the public key in the authorized_keys file.
Cat. ssh/A. pub>. ssh/authorized_keys
Permissions of machines A, B, and C must be modified.
Chmod 755. sshchmod 600. ssh/authorized_keys
A, B, and C each machine must modify the sshd configuration file vim/etc/ssh/sshd_config
RSAAuthentication yesPubkeyAuthentication yesAuthorizedKeysFile. ssh/authorized_keysGSSAPIAuthentication noUseDNS no Restart SSHD service
Service sshd restartDone

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.