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

B Server: 192.168.0.102

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/id_rsa.pub. Public key

The key fingerprint is:

c1:26:cc:88:2b:05:dd:c3:6b:1e:78:5d:da:9c:da:8a

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


SCP id_rsa.pub 192.168.0.101:/root/.ssh/#把公钥拷贝到A服务器


operation on Server A

CD ~/.ssh/

MV Id_rsa.pub Authorized_keys

chmod Authorized_keys


Test

On the B server 192.168.0.102

SSH 192.168.0.101 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 id_rsa.pub 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 http://irow10.blog.51cto.com/2425361/1841415

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

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.