[root@kafka01 .ssh]# ssh-copy-id -i ~/.ssh/id_rsa.pub kafka02
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host'kafka02 (192.168.184.202)' can't be established.
ECDSA key fingerprint is SHA256:VgM185hBJVyOYeb0tUEXlfALadKx63UcN0OeWAWf1CI.
ECDSA key fingerprint is MD5:6e:8a:c1:a5:c7:9a:a0:a9:47:bc:ad:76:1b:93:c7:5f.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@kafka02's password: Number of key(s) added: 1Now try logging into the machine, with: "ssh 'kafka02'"
and check to make sure that only the key(s) you wanted were added.
5:测试kafka01服务器是否可以免密登录kafka02服务器:(测试成功了如下)
[root@kafka01 ~]# ssh kafka02
Last failed login: Wed Aug 3112:43:58 CST 2022 from kafka01 on ssh:notty
There were 5 failed login attempts since the last successful login.
Last login: Wed Aug 3110:56:46 2022 from 192.168.184.1
[root@kafka01 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub kafka03
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@kafka03's password: Number of key(s) added: 1Now try logging into the machine, with: "ssh 'kafka03'"
and check to make sure that only the key(s) you wanted were added.
7:测试kafka01服务器是否可以免密登录kafka03服务器:(测试成功了如下)
[root@kafka01 ~]# ssh kafka03
Last login: Wed Aug 3113:14:03 2022 from kafka01