Set up A Secret communication example between multiple Linux hosts: A to B set up the secret-free communication
-t specifies the type of secret key
RSA secret key Type
Key directory: /root/.ssh/
(if the root account, note: The key pair is not shared between different users)
Private key id_rsa
Public Key id_rsa.pub
Lock
The second step is to edit the authentication file under the host root account (other accounts)
vi /root/.ssh/authorized_keys
Copy the public key content generated by the previous a host id_rsa.pub
to the B host authorized_keys
The third step is to edit the SSH configuration file for Host B
vim /etc/ssh/sshd_config
Find the AuthorizedKeysFile %h/.ssh/authorized_keys
comment to remove
Step Fourth Restart the B host SSH service
/etc/init.d/ssh restart
Fifth step a host verification through
ssh [email protected]主机ip
If there is a C host with the B root account to establish a secret-free communication, you can directly append the generated public key to the root account of the B host authorized_keys
, and then restart.
Establish a secret-free communication between multiple Linux hosts