Linux-主机之间创建免密
一、四台主机进行免密
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-主机之间创建免密的更多相关文章
- 多台linux主机之间建立免密通信
多台linux主机之间设置免密通信 例:A 向 B设置免密通信 第一步 A生成密钥对 ssh-keygen -t rsa -t 指定秘钥的类型 rsa 秘钥类型 密钥目录:/root/.ssh/(如果 ...
- Linux主机之间ssh免密登录配置方法
由于公司的生产环境有很多台Linux的CentOS服务器, 为了方便机子(假设两台机子A,B)互相之间免密ssh, scp命令操作,配置如下 1. 在A.B上分别创建本机的公钥和私钥,输入命令后连续三 ...
- Linux中配置主机之间的免密ssh登陆
假如 A 要登陆 B在A上操作:1.首先生成密钥对 ssh-keygen (提示时,直接回车即可) 2.再将A自己的公钥拷贝并追加到B的授权列表文件authorized_keys中 ssh-copy- ...
- linux 服务器之间配置免密登录
客户机:172.16.1.2 远程机:172.16.1.3 1.远程机 a.允许root用户通过22端口登录 vi /etc/ssh/sshd_config PORT 22 PermitRootLog ...
- 【Linux】服务器之间的免密登录脚本
在实际运维的过程中,经常需要用到免密登录,下面这个脚本实现服务器之间的免密登录,如下 比如,要实现A服务器与B.C.D服务器的免密登录,只需要将B.C.D服务器的IP地址写在serverlist.tx ...
- Linux OS 集群 免密登录
1. ssh-keygen 生成密钥 2. ssh-copy-id 集群主机名 参考: [图文详解]linux下配置远程免密登录
- Linux系列——配置SSH免密登录
在进行配置之前需要先关闭防火墙.配置hosts映射. 具体参见:Linux系列--常规基础操作 下面重点说明如何配置SSH: 1.编辑sshd服务配置文件,开启免密验证, vi /etc/ssh/ ...
- 两台Linux主机之间文件的复制
使用scp命令可以实现两台Linux主机之间的文件复制,基本格式是: scp [可选参数] file_source file_target 1. 复制文件 命令格式: scp local_file r ...
- Linux机器之间SSH免密钥登录设置
SSH免密钥登录 私钥:密钥留在本机 公钥:密钥发给其他机 hadoop01 生成密钥: ssh-keygen -t rsa (密钥存放路径:/root/.ssh) id_rsa:私钥 id_rsa. ...
- Linux网络第四章:SSH远程管理及通过SSH实现服务器之间的免密连接
目录 一.SSH远程管理基础 1.ssh协议 2.ssh原理 3.配置文件解析 4.登录方法 5.使用ssh协议传输的命令 二.免密连接的实现 1.免密连接原理 2.免密实现环境准备 3.在客户端生成 ...
随机推荐
- RocketMQ(4) 消息的消费
消费者从Broker中获取消息的方式有两种:pull拉取方式和push推动方式.消费者组对于消息消费的模 式又分为两种:集群消费Clustering和广播消费Broadcasting. 1. 获取消息 ...
- python 字典列表,元组列表 列表嵌套字典 列表嵌套元组 字典嵌套列表
列表嵌套字典 l=[] for i in alist: kk = {} names.append(i.string) a_url.append(i.get('href')) kk['章节名']=i.s ...
- Alertmanager钉钉告警
一.部署alertmanager 1.1 创建目录 mkdir -p /deploy/app/alertmanager/config chmod -R 777 /deploy/app/alertman ...
- redisson分布式锁lua脚本翻译
1.获取锁 lock入参:keys[1]:自定义锁的key RLock lock = redissonClient.getLock(lockKey);argv[1]=锁的租期,默认30s argv ...
- 记spring boot启动出现Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.问题处理
今天拉下了一个新的springboot工程,启动时出现了Unable to start web server; nested exception is org.springframework.cont ...
- 通过python获取SSL证书到期时间
在前面的文章中曾介绍过如何通过openssl命令获取SSL证书的到期时间:通过zabbix监控ssl证书到期时间. 有人反馈实践中这种方式存在缺陷,可能会出现部分域名证书无法获取的情况,报错如下: 1 ...
- AutoFill Chrome插件 影响 Vue接口读取,导致页面卡死,caution: request is not finished yet!
今天页面突然卡死了,也不知道是因为什么,直连服务器,能行,自己本机nginx的,系统访问某个特定的api就会卡死. 经过尝试,发现今天测试的AutoFill影响的.
- AOSP中获取系统签名
制作系统签名: 1.将AOSP源码路径下build\target\product\security\platform.pk8和platform.x509.pem复制出来放在同一目录下 2.执行命令 后 ...
- 恶意软件开发(四)通过查找进程名进行DLL注入
通过进程名查找PID 当我们编写注入器的时候,肯定是希望直接通过进程名进行注入,而不是像上一篇笔记一样通过手动输入PID进行查找. 通过进程名查找PID的步骤如下: (1)创建系统中所有进程的快照 ( ...
- 记录--uni-app adb安卓wifi无线调试
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 方法一 adb connect连接调试 前提条件: 电脑已安装adb工具 手机和电脑连接的同一个WIFI CMD进入到adb工具所在目录, ...