一、四台主机进行免密

192.168.10.6

192.168.10.11

192.168.10.12

192.168.10.13

二、192.168.10.6主机生成密钥对,并将公钥传输到其它所有主机。

root@k8s-master01:~# ssh-keygen -t rsa -P ''
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:BkqF1ysQP9COkjGM3LEDoYP+akQaK8Zuef7VcmTnOR0 root@k8s-master01
The key's randomart image is:
+---[RSA 3072]----+
|.=o.++.. |
|+.=.++o . |
|+ *.=+ . |
|ooo.o.oo. |
|++ .. .So . E |
|++. .+ o o . |
|= .. o o + . |
| =.. . o . |
|o.o... |
+----[SHA256]-----+ root@k8s-master01:~# ssh-copy-id -i .ssh/id_rsa.pub root@192.168.10.6
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/id_rsa.pub"
The authenticity of host '192.168.10.6 (192.168.10.6)' can't be established.
ED25519 key fingerprint is SHA256:rP2GqlXjoG0UGi/kNixh1qXFg1dd1zJHIz2LutbTn80.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? 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@192.168.10.6's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@192.168.10.6'"
and check to make sure that only the key(s) you wanted were added. root@k8s-master01:~# ssh-copy-id -i .ssh/id_rsa.pub root@192.168.10.11
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/id_rsa.pub"
The authenticity of host '192.168.10.11 (192.168.10.11)' can't be established.
ED25519 key fingerprint is SHA256:sm5LyiMTU6zs8worQAgtjgx+rQPR/nXQIoBB+ETGPGU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? 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@192.168.10.11's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@192.168.10.11'"
and check to make sure that only the key(s) you wanted were added. root@k8s-master01:~# ssh-copy-id -i .ssh/id_rsa.pub root@192.168.10.13
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/id_rsa.pub"
The authenticity of host '192.168.10.13 (192.168.10.13)' can't be established.
ED25519 key fingerprint is SHA256:qibMIGG51Rj4vpV+yEsw0swurRYhrYWWZOWIBPQmC3g.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? 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@192.168.10.13's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@192.168.10.13'"
and check to make sure that only the key(s) you wanted were added.

Linux-主机之间创建免密的更多相关文章

  1. 多台linux主机之间建立免密通信

    多台linux主机之间设置免密通信 例:A 向 B设置免密通信 第一步 A生成密钥对 ssh-keygen -t rsa -t 指定秘钥的类型 rsa 秘钥类型 密钥目录:/root/.ssh/(如果 ...

  2. Linux主机之间ssh免密登录配置方法

    由于公司的生产环境有很多台Linux的CentOS服务器, 为了方便机子(假设两台机子A,B)互相之间免密ssh, scp命令操作,配置如下 1. 在A.B上分别创建本机的公钥和私钥,输入命令后连续三 ...

  3. Linux中配置主机之间的免密ssh登陆

    假如 A 要登陆 B在A上操作:1.首先生成密钥对 ssh-keygen (提示时,直接回车即可) 2.再将A自己的公钥拷贝并追加到B的授权列表文件authorized_keys中 ssh-copy- ...

  4. linux 服务器之间配置免密登录

    客户机:172.16.1.2 远程机:172.16.1.3 1.远程机 a.允许root用户通过22端口登录 vi /etc/ssh/sshd_config PORT 22 PermitRootLog ...

  5. 【Linux】服务器之间的免密登录脚本

    在实际运维的过程中,经常需要用到免密登录,下面这个脚本实现服务器之间的免密登录,如下 比如,要实现A服务器与B.C.D服务器的免密登录,只需要将B.C.D服务器的IP地址写在serverlist.tx ...

  6. Linux OS 集群 免密登录

    1. ssh-keygen  生成密钥 2. ssh-copy-id  集群主机名 参考: [图文详解]linux下配置远程免密登录

  7. Linux系列——配置SSH免密登录

    ​ 在进行配置之前需要先关闭防火墙.配置hosts映射. 具体参见:Linux系列--常规基础操作 下面重点说明如何配置SSH: 1.编辑sshd服务配置文件,开启免密验证, vi /etc/ssh/ ...

  8. 两台Linux主机之间文件的复制

    使用scp命令可以实现两台Linux主机之间的文件复制,基本格式是: scp [可选参数] file_source file_target 1. 复制文件 命令格式: scp local_file r ...

  9. Linux机器之间SSH免密钥登录设置

    SSH免密钥登录 私钥:密钥留在本机 公钥:密钥发给其他机 hadoop01 生成密钥: ssh-keygen -t rsa (密钥存放路径:/root/.ssh) id_rsa:私钥 id_rsa. ...

  10. Linux网络第四章:SSH远程管理及通过SSH实现服务器之间的免密连接

    目录 一.SSH远程管理基础 1.ssh协议 2.ssh原理 3.配置文件解析 4.登录方法 5.使用ssh协议传输的命令 二.免密连接的实现 1.免密连接原理 2.免密实现环境准备 3.在客户端生成 ...

随机推荐

  1. vmware虚拟机出现此电脑无法运行win11,虚拟机中安装win11系统教程

    一.点击新建虚拟机 二.选择自定义安装 三.默认 四.选择win11镜像 五.选择windows 六.命名 七.勾选安全引导 八.两个处理器即可 九.最低4G内存,接下来一直默认点下一步即可 十.创建 ...

  2. 9、mysql的并发参数调整

    从实现上来说,MySQL Server 是多线程结构,包括后台线程和客户服务线程.多线程可以有效利用服务器资源,提高数据库的并发性能.在Mysql中,控制并发连接和线程的主要参数包括 max_conn ...

  3. 9、zookeeper的核心ZAB协议

    ZAB协议 zab协议的全称是 Zookeeper Atomic Broadcast (zookeeper原子广播).zookeeper是通过zab协议来保证分布式事务的最终一致性 1.ZAB协议是专 ...

  4. 6、zookeeper应用场景-分布式唯一ID

    分布式唯一id案例 原理:使用zookeeper有序节点,节点后会加上有序的id,用这个id来当唯一ID 在过去的单库单表型系统中,通常第可以使用数据库字段自带的auto_ increment属性来自 ...

  5. MySQL面经总结

    MySQL日志 MySQL日志系统 MySQL查询 菜鸟教程SQL内连接 exist和in区别 sql语句优化 MySQL索引 覆盖索引 索引类型:主键索引,二级索引(辅助索引):唯一索引,普通索引, ...

  6. Codeforces Round #848 (Div. 2) A~F 题解

    A. Flip Flop Sum 能换 \(-1,-1\) 就换,不能能换 \(1,-1\) 或 \(-1,1\) 也可以,否则只能换 \(1,1\). B. The Forbidden Permut ...

  7. 谈谈Java的特点和优点以及选择Java的原因

    ​ 如果面试官问你:请你说说Java的特点和优点,为什么要选择Java?你该怎么回答? 得分点 Java的特点 Java与C++的区别 Java的优点 标准回答 Java是一门非常纯粹的面向对象的编程 ...

  8. [好文推荐] 如何保护价值上千万的Node.js源代码? - 主要是ncc

    如何保护价值上千万的Node.js源代码? https://zhuanlan.zhihu.com/p/84386456 一个强大的JS混淆器. github.com/javascript-obfusc ...

  9. Python | Flask 解决跨域问题

    Python | Flask 解决跨域问题 系列文章目录 目录 系列文章目录 前言 使用步骤 1. 引入库 2. 配置 1. 使用 CORS函数 配置全局路由 2. 使用 @cross_origin ...

  10. 云VR的未来发展方向

    随着元宇宙元年的到来,VR正呈现出蓬勃的发展势头.然而,更好的用户体验大多依赖于高性能PC或主机进行本地渲染,这使得用户的VR消费成本更高,在一定程度上影响了产业发展,成为业界亟待解决的问题. 的确, ...