centos configure SSH trust

A Machine B Machine Free adhesion to ssh:
Embodiment 1:

A database server: Dial vps

vim /etc/ssh/sshd_config

PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes

systemctl restart sshd.service
systemctl status sshd.service

systemctl enable sshd.service

ssh-keygen -t rsa

scp /root/.ssh/id_rsa.pub [email protected]:/root/id_rsa.pub
password:

B backup machine:

vim /etc/ssh/sshd_config

PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes


mkdir .ssh
cd .ssh
mkdir authorzied_keys
cat id_rsa.pub >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys 

A Machine B Machine Free adhesion to ssh:
mode 2:

A / B server settings:
vim /etc/ssh/sshd_config

PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes

1 ssh-keygen -t rsa
2 ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.1

Guess you like

Origin www.cnblogs.com/smileyang/p/12174029.html