Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to configure SSH one-way password-less access by CentOS

Shulou Source: shulou.com Published: 2022-06-01 17:40:37 10月05日 Update

Editor to share with you how to configure CentOS one-way password-less access to SSH, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

When studying a file system, we need to install the software to the client remotely and access it without SSH password, and we also need to transfer files to the client remotely. It is very inconvenient to enter the root password every time, so we think of using ssh key to generate the public key and private key to verify, and avoid having to enter the root password every time.

Server architecture:

System: CentOS 6.5x64

Main control terminal Avram 192.168.0.150

Remote host BVR 192.168.0.151

Principle:

Using ssh key to generate public key and private key, the key is equivalent to a key, and the public key is equivalent to a door lock, of course, we take the key to open the lock, by the same token, we put the key on the local server, that is, server A, and put the public key on the remote server, that is, remote host B, then we can log in to the remote host B without a password from the host A ssh.

Steps:

1. Generate public key and private key files without SSH password access on host An of the main control terminal.

[root@localhost] # ssh-keygen-t rsa

Note: in the execution of the command, press enter three times in a row to generate.

2. Upload the public key from the master to the remote host B.

[root@localhost] # ssh-copy-id-I / root/.ssh/id_rsa.pub root@192.168.0.151

You need to enter the root password of remote host B once in the middle.

3. Test the password-free SSH remote host B on the main control terminal.

[root@localhost ~] # ssh root@192.168.0.151

You can see that you have not entered the root password of host B, and you can remotely from A SSH to B.

The above is all the contents of the article "how to configure SSH one-way password-less access by CentOS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Password host public key master server service generation file article input one-way configuration that is content client client key system key not much Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB OPPO Reno Apple MySQL Docker