html电子商务网站模板下载,北京梵客家装官网,购物商城平台有哪些,搜索引擎有哪些好用SSH案例#xff1a;实现kafka01服务器能够免密登录kafka02和kafka03服务器的需求#xff08;不然后面一键启动的脚本将无法使用#xff09;⭐
1#xff1a;检查每台服务器是否都安装了SSH#xff1a;
[rootkafka01 ~]# rpm -qa |grep ssh
openssh-clients-7.4p1-21.el7.…SSH案例实现kafka01服务器能够免密登录kafka02和kafka03服务器的需求不然后面一键启动的脚本将无法使用⭐
1检查每台服务器是否都安装了SSH
[rootkafka01 ~]# rpm -qa |grep ssh
openssh-clients-7.4p1-21.el7.x86_64
libssh2-1.8.0-4.el7.x86_64
openssh-7.4p1-21.el7.x86_64
openssh-server-7.4p1-21.el7.x86_642在kafka01服务器上执行一直按回车即可
[rootkafka01 ~]# cd /root[rootkafka01 ~]# ssh-keygen3查看kafka01的.ssh目录 id_rsa 私钥id_rsa.pub (公钥)
[rootkafka01 ~]# cd /root/.ssh ls
id_rsa id_rsa.pub4在kafka01服务器上执行如下命令将公钥传给kafka02服务器实现kafka01能够免密登录kafka02 然后中途需要我们输入kafka02的密码再按回车即可
[rootkafka01 .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) cant 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
rootkafka02s 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服务器测试成功了如下
[rootkafka01 ~]# ssh kafka02
Last failed login: Wed Aug 31 12:43:58 CST 2022 from kafka01 on ssh:notty
There were 5 failed login attempts since the last successful login.
Last login: Wed Aug 31 10:56:46 2022 from 192.168.184.16在kafka01服务器上把公钥发给kafka03服务器实现kafka01能够免密登录kafka02和kafka03服务器 然后中途需要我们输入kafka03的密码再按回车即可
[rootkafka01 ~]# 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
rootkafka03s 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服务器测试成功了如下
[rootkafka01 ~]# ssh kafka03
Last login: Wed Aug 31 13:14:03 2022 from kafka01