一、环境配置
1、系统:CentOS release 5.6 IP:192.168.4.200 主机名:JW01
2、系统:CentOS release 5.9 IP:192.168.4.244 主机名:JW02
3、系统:CentOS release 5.3 IP:192.168.4.232 主机名:KT01
4、系统:Red Hat release 4 IP:192.168.4.201 主机名:KT02
二、服务器配置
1、在每台服务器上都执行ssh-keygen -t rsa 生成密钥
[root@jw01 .ssh]# ssh-keygen -t rsa
[root@jw02 .ssh]# ssh-keygen -r rsa
[root@kt01 .ssh]# ssh-keygen -t rsa
[root@kt02 .ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): #回车代表无需密码登陆
Enter passphrase (empty for no passphrase): #回车
Enter same passphrase again: #回车
Your identification has been saved in /root/.ssh/id_rsa. #代表私钥
Your public key has been saved in /root/.ssh/id_rsa.pub. #代表公钥</