路来了
这个作者很懒,什么都没留下…
展开
-
Shell脚本while批量IP映射主机名
function host() { user=root passwd=123456 exec 0< ip.txt exec 1> host.txt while read line do sshpass -p ${passwd} ssh -n -o StrictHostKeyChecking=no ${user}@${line} "echo -ne '${line}\原创 2021-03-28 14:32:18 · 419 阅读 · 1 评论 -
Shell脚本while批量修改主机名
1.简述实现方式1.通过ssh实现批量远程命令2.通过ssh实现批量远程命令,修改主机名2.Shell脚本while批量修改主机名vi ip.txt192.168.0.2192.168.0.3192.168.0.4192.168.1.2user=rootpasswd=123456exec 0< ip.txtwhile read linedo ipb=$(echo ${line}|cut -d . -f 3) ipc=$(.原创 2021-03-25 16:45:21 · 645 阅读 · 0 评论 -
Shell脚本while批量查看显卡驱动
#/bin/bashpasswd=123456user=rootexec 0< ip.txtwhile read linedo echo $line #更新apt源 #sshpass -p ${passwd} ssh -n -o StrictHostKeyChecking=no $user@$line "echo $passwd | sudo --stdin sed -i "s/archive.ubuntu.com/mirrors.aliyu原创 2021-03-10 16:16:04 · 307 阅读 · 0 评论 -
Shell脚本while批量查看服务器是否可以上网
1.简述while批量的实现过程1.创建一个ip.txt的文件存放IP2.通过while read 把ip.txt的文件第一行所有的内容赋值给变量line3.通过ssh远程命令ping qq.com2.while批量查看服务器是否可以上网vi ip.txt192.168.0.2192.168.0.3192.168.0.4#!/bin/bashpasswd=123456user=rootexec 0< ip.txtwhile read linedo.原创 2021-02-21 17:49:42 · 1292 阅读 · 7 评论 -
Shell脚本批量Parted分区
1.parted分区vi part.sh#!/bin/bashipaddr=192.168.0passwd=123456user=(root wsu)part=$(lsblk | awk '{print $1}'| grep 'sdb'| grep -v 'sdb1')for ip in {2..4};do echo $ipaddr.$ip sshpass -p ${passwd} ssh -o StrictHostKeyChecking=no ${user[0].原创 2021-02-09 10:29:57 · 2206 阅读 · 1 评论 -
Shell脚本批量查看磁盘根目录容量大小
1.简述实现方式1.通过ssh远程登录执行命令2.通过命令 df -lh | sed -n ‘1p;6p’ 查看磁盘容量大小2.编辑Shell脚本#/bin/bashipaddr=192.168.0passwd=123456user=(root wsu)for ip in {2..4};do echo $ipaddr.$ip sshpass -p ${passwd} ssh -o StrictHostKeyChecking=no ${u.原创 2021-01-20 14:13:04 · 1196 阅读 · 0 评论 -
Shell脚本批量修改主机名
1.概述实现方式1.通过ssh公钥远程登录2.通过ssh远程执行命令IP主机名称公钥处理方式192.168.0.2node-0-2生成无密码公钥(生成无密码公钥,也需要复制公钥)192.168.0.3node-0-3复制公钥192.168.0.4node-0-4复制公钥2.编辑Shell脚本#!/bin/bashipaddr=192.168.0passwd=123456user=(root wsu)ssh-keygen.原创 2020-12-22 11:46:19 · 1197 阅读 · 0 评论 -
Shell脚本安装ansible
1.简述ansibleAnsible是一种IT自动化工具。它可以配置系统,部署软件并协调更高级的IT任务,例如连续部署或零停机滚动更新。Ansible的主要目标是简单和易用。它还非常关注安全性和可靠性,其特点是活动部件最少,使用OpenSSH进行运输(使用其他运输方式和拉动模式作为替代方案)以及一种围绕人员(即使是不熟悉的人)可审核性设计的语言。IP集群架构192.168.0.2控制端192.168.0.3被控端192.168.0.4被控端.原创 2020-12-19 11:02:42 · 544 阅读 · 2 评论 -
Shell脚本安装DVWA
文章目录1.简述DVWA2.编辑脚本4.打开浏览器IP/DVWA-master(目录)1.简述DVWADVWA的目的是通过简单易用的界面来实践一些最常见的Web漏洞,这些漏洞具有不同的难度。IP框架搭建172.25.0.100Linux+Httpd(Apache)+Mariadb+PHP7.3DVWA2.编辑脚本vi DVWA.sh#!/bin/bashecho -e '\033[32m--------------install Lamp-------原创 2020-06-03 19:46:25 · 232 阅读 · 0 评论 -
Shell脚本安装Python3
文章目录1.上传Python3.7源包2.编辑脚本1.上传Python3.7源包ll Python-3.7.3.tgz -rw-r--r--. 1 root root 22973527 May 1 2019 Python-3.7.3.tgz2.编辑脚本vi python3.7.sh#!/bash/binecho -e '\033[32m--------------install python3.7---------------\033[0m'yum install gcc原创 2020-06-02 22:49:15 · 505 阅读 · 0 评论 -
CentOS7Shell脚本部署Docker-ce
文章目录1.Shell脚本部署Docker-ce2.Docker拉取CentOS7镜像1.Shell脚本部署Docker-ce#!/bin/bashsed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/configsetenforce 0getenforce systemctl disable firewalld && systemctl stop firewalldyum install wget -y原创 2020-05-12 12:22:23 · 458 阅读 · 0 评论 -
CentOS7Shell脚本部署Lamp
CentOS7脚本部署Lamp1.Shell脚本关闭Selinux安全设置和防火墙2.Shell脚本部署Lamp1.Shell脚本关闭Selinux安全设置和防火墙#!/bin/bashsed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/configsetenforce 0getenforce systemctl...原创 2020-04-22 17:35:05 · 421 阅读 · 0 评论