当前位置:网站首页>ssh-copy-id 批量免密脚本
ssh-copy-id 批量免密脚本
2022-06-21 05:40:00 【瘋飆的蝸牛】
#ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
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:OMY2Xk1t4/BXpKTD093IzllXOyetZw5DIv4EPbVAPOE [email protected]
The key's randomart image is:
+---[RSA 2048]----+
| o+.o o|
| =oB B+|
| = E.OoO|
| . . + B X *+|
| B S o + O o|
| + + o . * |
| . . .|
| |
| |
+----[SHA256]-----+
命令脚本copy-key.sh
#!/bin/bash
IFSBAK=$IFS
IFS=$'\n'
for line in $(cat /root/iplist);do
myip=$(echo "$line" | awk '{print $1}')
mypd=$(echo "$line" | awk '{print $2}')
/usr/bin/sshpass -p "$mypd" ssh-copy-id -i /root/.ssh/id_rsa.pub $myip
done
IFS=$IFSBAK
iplist文件
192.168.1.1 123456789
192.168.1.2 mima
192.168.1.3 key
边栏推荐
- VMware new oraclelinux6.5 virtual machine
- Music genre classification based on CNN
- Object.assign() 对象合并和Object.keys()获取对象名
- 关于PHP签名中的容易犯错问题记录
- Sentinel熔断限流真的太丝滑了
- jmeter里面的json提取器和调试器的用法
- PhpMyAdmin (MySQL) common shell writing methods
- Système de gestion de l'information sur les transports publics basé sur SSM + MySQL + layui + jsp
- mac os MAMP 安装redis 报错问题 ./common.h:12:10: fatal error: ‘zend_smart_str.h‘ file not found
- Yyds dry goods inventory solution Huawei machine test: conversion between integer and IP address
猜你喜欢

微服务之分布式事务Seata

Mac NAMP Pro comes with MySQL 5.7 setup SQL_ Model remove only_ FULL_ GROUP_ Invalid by may be caused by:,

Editing tutorial for canape A2L files

The Mac OS MAMP installs redis with an error/ common. h:12:10: fatal error: ‘zend_ smart_ str.h‘ file not found

Music genre classification based on CNN

一文全面解读CKA认证的含金量、详细介绍及考试攻略

常見的存儲類型

面试题_V1.0

83. (cesium chapter) how to run the cesium example

Mac MAMP Pro installation PHP extension method
随机推荐
[open source tutorial] DIY tutorial of step-by-step electric adjustment [Author: I love Laurie, Laurie]
工业级的内存拷贝函数实现
In the lab, can the full link data governance be replicated? And I want to ask how the data source connection is handled. Can I directly connect to the local database
At the codeless Explorer conference, Qingliu invites you to discuss the way of digital transformation practice
In the NLP field, what are the most practical and effective skills or ideas used in text classification, NER, QA, generation, relationship extraction, etc?
Conscience recommends a seven day National Day holiday. Where is the least cheap place to go?
Update syntax of Oracle notes
基于SSM+Hui+MySQL的高校大学生信息管理系统
build opencv3.4.16
build opencv3.4.16
Librosa 𞓜 the most humorous explanation of Mel spectrum
JdbcDynamicTableSource支持谓词下推?
C language: randomly input the scores of each subject in each student, and require each student to rank the average scores of all subjects from low to high to find out the average scores of each stude
常见的存储类型
无代码探索者大会,轻流邀您共同探讨数字化转型实践之路
Oraclelinux6.5 graphical installation Oracle11g
Blog forum system based on ssm+mysql+layui
Redis 缓存穿透、缓存击穿、缓存雪崩
Years of love, thanks for your hard work, and then start
base64格式的图片转成文件格式的图片并上传到服务器