centos配置SSH互信
Posted smileyang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos配置SSH互信相关的知识,希望对你有一定的参考价值。
A机器免密ssh到B机器:
方式1:
A 数据库服务器:拨号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 root@192.168.1.1:/root/id_rsa.pub password: B备份机器: 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机器免密ssh到B机器:
方式2:
A/B服务器设置: 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
以上是关于centos配置SSH互信的主要内容,如果未能解决你的问题,请参考以下文章