设备编号 | 主机名 | 系统 | IP地址 |
---|---|---|---|
1 | master | centos7.2 | 10.0.0.10 |
2 | node1 | centos7.2 | 10.0.0.11 |
3 | node2 | centos7.2 | 10.0.0.12 |
[root@master ~]# vi /etc/hosts
添加如下内容
10.0.0.10 master
10.0.0.11 node1
10.0.0.12 node2
ssh-keygen
[root@master ~]# ssh-keygen
[root@master ~]# ssh-copy-id node1
[root@master ~]# ssh-copy-id node2
验证
[root@master ~]# ssh node1
[root@master ~]# ssh node2