1、
[root@server ~]# ssh-keygen -t rsa #生成密钥
[root@server ~]# ssh-copy-id root@192.168.140.50 #配置密钥对验证
[root@server ~]# ssh-agent bash #免交互代理
[root@server ~]# ssh-add
[root@server ~]# ssh root@192.168.140.50 #免交互登录
2、
[root@server ~]# ssh-keygen -t rsa #生成密钥
[root@server ~]# ssh-copy-id 192.168.140.60 #免密登录
[root@server ~]# ssh root@192.168.140.60 #登录验证
[root@client1 ~]# exit
[root@client1 ~]# ls -a #查看文件
[root@client1 ~]# cd .ssh/
[root@client1 .ssh]# ll
[root@client1 .ssh]# cat authorized_keys