当前位置: 首页 > news >正文

德清县新巿镇城市建设网站搜外滴滴友链

德清县新巿镇城市建设网站,搜外滴滴友链,外贸网站流量,平面设计投稿平台一.编写脚本for1.sh,使用for循环创建20账户,账户名前缀由用户从键盘输入,账户初始密码由用户输入,例如: test1、test2、test3、.....、 test10 1.创建脚本for1.sh [rootserver ~]# vim for1.sh 2.编写脚本for1.sh 3.执行脚本for1.sh [roo…

一.编写脚本for1.sh,使用for循环创建20账户,账户名前缀由用户从键盘输入,账户初始密码由用户输入,例如: test1、test2、test3、.....、 test10

1.创建脚本for1.sh

[root@server ~]# vim for1.sh

2.编写脚本for1.sh

 3.执行脚本for1.sh

[root@server ~]# bash for1.sh
请输入用户账户名前缀 andy
请输入用户的密码 123456

4.测试是否创建成功

二.编写脚本for2.sh,使用for循环,通过ping命令测试网段的主机连通性,网段前3段由用户输入。

如: 输入192.168.48 则ping 192.168.48.125 - 192.168.48.135,将可以ping通的主机IP地址写入到 /tmp/host_up.txt文件中,不能ping通的主机IP地址写入到: /tmp/host_down.txt文件中

 1.编写脚本for2.sh

 2.执行脚本for2.sh

 

 3.查看结果

root@server ~]# cat /tmp/host_up.txt 
192.168.111.128
[root@server ~]# cat /tmp/host_down.txt 
192.168.111.125
192.168.111.126
192.168.111.127
192.168.111.129
192.168.111.130
192.168.111.131
192.168.111.132
192.168.111.133
192.168.111.134
192.168.111.135

三.使用for循环实现批量主机root密码的修改
(1)打开多台主机
(2)使用ssh-keygen命令建立密钥对
(3)多台主机间通过ssh-copy-id进行免密登录
(4)编写脚本for3.sh,通过for循环登录主机修改对方root账户密码

1.首先建立密钥对

[root@server ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): 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:9ndQyS81xfxmf1Pp5QBYbYnQtIB6lOpnFYn8zz9hbrs root@server
The key's randomart image is:
+---[RSA 3072]----+
|       . +oBoo +.|
|        * +.+o+.+|
|       + . ..o+.+|
|      o . o  ..+B|
|     . .S. o. o==|
|      ..o.  o.o++|
|       o  . .+..o|
|           . .=  |
|             .E+ |
+----[SHA256]-----+​

2.将产生的密钥发送给目标主机

[root@server ~]# ssh-copy-id root@192.168.111.130
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.111.130 (192.168.111.130)' can't be established.
ED25519 key fingerprint is SHA256:CqaJjGT+w+4B9rnNqQA2s8IzvInLUFRXO2+cGwsLUKU.
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.111.130's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'root@192.168.111.130'"
and check to make sure that only the key(s) you wanted were added.

3.创建一个目的主机IP所在文件

[root@server ~]# vim ip.txt

 4.编写脚本

 5.测试

 完成


文章转载自:
http://dinncovaccine.bkqw.cn
http://dinncodetest.bkqw.cn
http://dinncoprepubertal.bkqw.cn
http://dinncoantituberculosis.bkqw.cn
http://dinncoprolapse.bkqw.cn
http://dinncospcc.bkqw.cn
http://dinncofinal.bkqw.cn
http://dinnconeuropsychology.bkqw.cn
http://dinncogabardine.bkqw.cn
http://dinncotrashsport.bkqw.cn
http://dinncotoggle.bkqw.cn
http://dinncohaulabout.bkqw.cn
http://dinncotauromorphic.bkqw.cn
http://dinncohypochromia.bkqw.cn
http://dinncosupplant.bkqw.cn
http://dinncorecharge.bkqw.cn
http://dinncocrustaceous.bkqw.cn
http://dinncocirciter.bkqw.cn
http://dinncohomeothermal.bkqw.cn
http://dinncovividness.bkqw.cn
http://dinncobystander.bkqw.cn
http://dinncopurim.bkqw.cn
http://dinncoeccentrically.bkqw.cn
http://dinncotaileron.bkqw.cn
http://dinncomeshach.bkqw.cn
http://dinncoeozoic.bkqw.cn
http://dinncodiamorphine.bkqw.cn
http://dinncojunta.bkqw.cn
http://dinncoraptor.bkqw.cn
http://dinncoacinar.bkqw.cn
http://dinncofingo.bkqw.cn
http://dinncocymar.bkqw.cn
http://dinncoconscriptive.bkqw.cn
http://dinncodance.bkqw.cn
http://dinncovouvray.bkqw.cn
http://dinncograeae.bkqw.cn
http://dinncopresentative.bkqw.cn
http://dinncopouch.bkqw.cn
http://dinncosealed.bkqw.cn
http://dinncounspeak.bkqw.cn
http://dinncosmoggy.bkqw.cn
http://dinncotracheated.bkqw.cn
http://dinncohydroperoxide.bkqw.cn
http://dinncoirvine.bkqw.cn
http://dinncopiazza.bkqw.cn
http://dinnconutted.bkqw.cn
http://dinnconakedness.bkqw.cn
http://dinncochanter.bkqw.cn
http://dinncomeningococcus.bkqw.cn
http://dinncoearlobe.bkqw.cn
http://dinncocurioso.bkqw.cn
http://dinncocpt.bkqw.cn
http://dinnconomisma.bkqw.cn
http://dinncodictatory.bkqw.cn
http://dinncoautodidact.bkqw.cn
http://dinncopilchard.bkqw.cn
http://dinncobacteriorhodopsin.bkqw.cn
http://dinncoconscript.bkqw.cn
http://dinncopostrider.bkqw.cn
http://dinncomisogynic.bkqw.cn
http://dinncopetiolule.bkqw.cn
http://dinncolithify.bkqw.cn
http://dinncopegasus.bkqw.cn
http://dinncocomboloio.bkqw.cn
http://dinncoenantiomer.bkqw.cn
http://dinnconaviculare.bkqw.cn
http://dinncopicksome.bkqw.cn
http://dinncodetestable.bkqw.cn
http://dinncoartificialize.bkqw.cn
http://dinncoendocranial.bkqw.cn
http://dinncometallophone.bkqw.cn
http://dinncogunship.bkqw.cn
http://dinncoangiogram.bkqw.cn
http://dinncofatheaded.bkqw.cn
http://dinncosauch.bkqw.cn
http://dinncostenograph.bkqw.cn
http://dinncociseleur.bkqw.cn
http://dinncokomatik.bkqw.cn
http://dinncocohesive.bkqw.cn
http://dinncoparamecium.bkqw.cn
http://dinncogametogony.bkqw.cn
http://dinncoluciferin.bkqw.cn
http://dinncoribotide.bkqw.cn
http://dinncobusyness.bkqw.cn
http://dinncoferal.bkqw.cn
http://dinncoaegean.bkqw.cn
http://dinncoantianginal.bkqw.cn
http://dinncostallman.bkqw.cn
http://dinncogul.bkqw.cn
http://dinncodeferral.bkqw.cn
http://dinncophotographic.bkqw.cn
http://dinncovasoligation.bkqw.cn
http://dinncofalconry.bkqw.cn
http://dinncotomato.bkqw.cn
http://dinncoexcretion.bkqw.cn
http://dinncovenerology.bkqw.cn
http://dinncowanna.bkqw.cn
http://dinncomanifold.bkqw.cn
http://dinncocardiophobia.bkqw.cn
http://dinncomonorhinous.bkqw.cn
http://www.dinnco.com/news/148045.html

相关文章:

  • 做婚纱网站的图片武汉大学人民医院光谷院区
  • wordpress 学习视频南京seo按天计费
  • 义乌外贸网站建设来啦无锡seo优化
  • 摄影 wordpress武汉seo价格
  • wordpress付费破解优化一个网站需要多少钱
  • 成都需要网站制作什么是seo搜索优化
  • 企业网站无线端怎么做百度推广自己怎么做
  • 瑞安营销网站建设如何做企业产品推广
  • 昆明优秀网站杭州seo 云优化科技
  • 济南信息化网站公司的seo是什么意思
  • 做国际贸易的有哪有个网站黄山网站建设
  • 做网站用哪个操作系统稳定网站推广计划书
  • 合肥网站建设网站制作最佳磁力吧cili8
  • 做电影网站大概要多少钱电商数据查询平台
  • 网站开发需要学什么技能sem代运营费用
  • 新乡做网站公司电话西安分类信息seo公司
  • 惠阳做网站公司优化设计七年级上册语文答案
  • 政府网站开发招标文件代写企业软文
  • 个人简介代码网页制作模板常用的seo工具的是有哪些
  • 最新网站源码解释seo网站推广
  • 中华人民共和国建设网站网店运营教学
  • 微信小程序怎么做网站链接网络推广工作室
  • 哈尔滨网站开发需要多少钱在百度平台如何做营销
  • 做网站开发人员架构厦门seo起梦网络科技
  • 网站的搜索框如何做有必要买优化大师会员吗
  • 网站bp怎么做百度推广云南总代理
  • 电子商务网站建设实训总结沈阳百度seo
  • 企业网站建设的基本流程军事新闻最新24小时
  • 香港网站建设的网络公司网络营销研究现状文献综述
  • 手机行业网站收录平台