Linux SSH one-way trust and multi-node mutual trust

Source: Internet
Author: User
Tags node server

Usually in the use of SSH under Linux, we need the target machine to open the SSHD service and then connect with the SSH client in the past to the designated user to log on, under normal circumstances we need to enter the login password to successfully login, But in a cluster or similar scenario we have a lot of machines that need to be randomly accessed through SSH, if one of the input passwords is too cumbersome. Therefore, we need to establish a key-free login mode.

One-way trust configuration

A server:

B Server:

Requires B server to be able to password-free access to a server

Actions on Server B:

[email protected]. ssh]# ssh-keygen-t RSA #rsa算法的证书

Generating public/private RSA key pair. (The following carriage return)

Enter file in which to save the key (/ROOT/.SSH/ID_RSA):

/root/.ssh/id_rsa already exists.

Overwrite (y/n)? Y (because my certificate already exists, overwrite can be)

Enter passphrase (empty for no passphrase):

Enter same Passphrase again:

Your identification has been saved In/root/.ssh/id_rsa. Private key

Your public key has been saved in/root/.ssh/ Public key

The key fingerprint is:


The certificate generates a ID_RSA (private key) |& (public key)


operation on Server A

CD ~/.ssh/

MV Authorized_keys

chmod Authorized_keys


On the B server

SSH Date

Multi-node Trust configuration

Each node server runs ssh-keygen-t RSA under the. SSH directory, and then copies a copy of the public key in the of all nodes into the Authorized_keys file.

Finally, put a copy of the. SSH directory for each node of the Authorized_keys file, and change the permissions to 600.

This multiple nodes can be password-free access to each other!

This article is from the "Tranquility Zhiyuan" blog, please be sure to keep this source

Linux SSH one-way trust and multi-node mutual trust

Related Article

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: 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.