主机A要ssh链接主机B
主机A:
[root@localhost .ssh]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
[root@localhost .ssh]# cp id_rsa.pub authorized_keys
[root@localhost .ssh]# scp authorized_keys root@192.168.1.82:.ssh/authorized_keys
输入yes
使用免密登录
[root@localhost .ssh]# ssh root@192.168.1.82