1. 准备
shell
# 安装ssh
yum install openssh-server
# 安装完毕后,开启并设置启动自启
systemctl start sshd
systemctl enable sshd
# 查看状态
systemctl status sshd

2. 配置
shell
# 生成密钥
ssh-keygen

shell
# 将服务器A的公钥添加到服务器B里面
# root@192.168.195.20 服务器B的用户名和IP,添加时许哟啊密码认证
cd /root/.ssh/
ssh-copy-id -i id_rsa.pub root@192.168.195.20

3. 测试
