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

常用日常脚本

日常脚本
1:主机初始化脚本
通用脚本: curl -s http://内网ip:3333/soft/shell/init/init_vm.sh |sh 
以下是单一功能脚本
2:定时检测dns,并修改为固定dns
curl -s http://内网ip:3333/soft/shell/init/deploy_dns_product.sh | sh
3:修改Shell颜色
curl -s http://内网ip:3333/soft/shell/init/change_shell_color.sh | sh
4:修改主机名
北京 curl -s http://内网ip:3333/soft/shell/init/set_hostname.sh | sh 
5:添加ansible用户
curl -s http://内网ip:3333/soft/shell/init/add_ansibleops.sh | sh
6:挂载磁盘
北京 curl -s http://内网ip:3333/soft/shell/init/mount_disk_y.sh | sh 
以下是dns检测脚本,机器阿里云华为云机器创建完毕后可以执行该脚本检查dns配置: 国内#curl -s http://内网ip:3333/soft/shell/init/check_dns.py | python 
7:添加清理日志脚本
curl -s http://内网ip:3333/soft/shell/init/clean_up_logs.sh -o /opt/scripts/clean_up_logs.sh curl -s http://内网ip:3333/soft/shell/init/setcron.sh | bash ~~###

8:添加堡垒机用户 不再使用 curl -s http://内网ip:3333/soft/shell/init/addSudoUser.sh | bash~~
9:优化内核参数
curl -s http://内网ip:3333/soft/shell/init/optimised.sh | sh
10:升级内核
curl -s http://内网ip:3333/soft/shell/init/update_only_kernel.sh | sh
(搜索可用内核方法
    rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
    rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
    yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
    下载内核到本地yum --disablerepo="*" --enablerepo="elrepo-kernel" -y install kernel-ml.x86_64 --downloadonly --downloaddir=./
    将下载的内核放到soft/shell/init/kernel
    修改soft/shell/init/update_only_kernel.sh脚本内内核版本

11:增加虚拟内存
curl -s http://内网ip:3333/soft/shell/add_swap.sh | sh
12:自动增加clean_up_logs.sh等脚本并配置cron任务
curl -s http://内网ip:3333/soft/shell/auto_add_scripts.sh |sh
13: 自动配置yum repo,华为云
curl -s http://内网ip:3333/soft/shell/init_yum_repo.sh |sh
14:升级node_exporter 
15:测试资源池主机挂载nfs
curl -s http://内网ip:3333/soft/shell/init/mount_nfs.sh | sh
16:开启允许ssh密码登录、root远程登录,修改root密码
北京 curl -s http://内网ip:3333/soft/shell/init/open_sshd.sh | sh 
17: 禁用ssh root密码登录
curl -s http://内网ip:3333/soft/shell/init/disable_passwordLogin.sh | sh
18: 添加jumpserveruser用户
curl -s http://内网ip:3333/soft/shell/init/add_jumpserveruser.sh | sh
19: 禁用用户
wget -q -O /tmp/disable_user.sh http://内网ip:3333/soft/shell/init/disable_user.sh && bash /tmp/disable_user.sh
20:开启远程访问控制脚本(tcp_wrapper)
curl -s http://内网ip:3333/soft/shell/init/remote_control.sh | sh
21:VM常用操作脚本合集
wget -q -O /tmp/init_base.sh http://内网ip:3333/soft/shell/init/init_base.sh && bash /tmp/init_base.sh
22: 加入效能平台监控
23:开启授权主机远程访问
wget -q -O /tmp/add_remote_control.sh http://内网ip:3333/soft/shell/init/add_remote_control.sh && bash /tmp/add_remote_control.sh
24:限制传输速率
curl -s http://ip/upload/acl.sh | sudo bash
25: 测试obs上传、下载、查看、删除对象权限(华为云)(北京)
wget -q -O /tmp/check_obs_v2.sh http://内网ip:3333/soft/shell/init/check_obs_v2.sh && bash /tmp/check_obs_v2.sh 注: 请输入oss的endpoint: 请输入访问用户的ak: 请输入访问用户的sk: 请输入obs桶名称: 请输入obs桶的目录,不输入默认为 / 目录; 例如/test:
测试obs上传、下载、查看、删除对象权限(华为云) wget -q -O /tmp/check_obs_v2.sh http://内网ip:3333/jcss_ops/check_obs_v2.sh && bash /tmp/check_obs_v2.sh 注: 请输入oss的endpoint: 请输入访问用户的ak: 请输入访问用户的sk: 请输入obs桶名称: 请输入obs桶的目录,不输入默认为 / 目录; 例如/test:
26:测试oss上传、下载、查看、删除对象权限(阿里云)
wget -q -O /tmp/check_oss_v2.sh http://内网ip:3333/soft/shell/init/check_oss_v2.sh && bash /tmp/check_oss_v2.sh 注: 请输入oss的endpoint: 请输入访问用户的ak: 请输入访问用户的sk: 请输入oss桶名称: 请输入oss桶的目录,不输入默认为 / 目录; 例如/test:
27:
28: 部署bind9 DNS服务
curl -s http://内网ip:3333/soft/shell/init/install_dns.sh | sh

30:禁用ssh root远程登录
curl -s http://内网ip:3333/soft/shell/init/disable_permitrootLogin.sh | sh

32: 解除虚拟机初始化安全配置
北京 curl -s http://内网ip:3333/soft/shell/init/stop_safe.sh | sh 
33:添加安全审计用户audituser
北京 curl -s http://内网ip:3333/soft/shell/init/add_audituser.sh | sh 
34:安装安骑士
wget https://update2.aegis.aliyun.com/download/install/2.0/linux/AliAqsInstall.sh && chmod +x AliAqsInstall.sh && ./AliAqsInstall.sh -k=4zO6Z5
35:安装zabbix-agent
curl -s http://内网ip:3333/soft/shell/init/install_zabbix-agent.sh | sh
36: 将装有zabbix-agent监控主机自动加入zabbix-web中
curl -s http://内网ip:3333/soft/shell/init/zabbix-create_host.sh | sh
37:离线一键部署 openrsty:
curl -s http://172.20.3.13/upload/deploy_waf_offline.sh | sh curl -s http://内网ip:3333/soft/waf/deploy_waf_offline.sh | sudo bash
38:配置华为内网yum源
北京 curl -s http://内网ip:3333/soft/shell/init/mirrors_source.sh | sh 
39 添加rundeck用户
北京 curl -s http://内网ip:3333/soft/shell/init/add_rundeck.sh | sh
40 ECS初始化交付执行脚本
北京 curl -s http://内网ip:3333/soft/shell/init/init_ecs.sh | sh

http://www.lryc.cn/news/334351.html

相关文章:

  • Longan Pi 3H 开发板体验
  • SpringCloud Alibaba Sentinel 创建流控规则
  • Mysql底层原理五:如何设计、用好索引
  • python学习杂记
  • C# Socket发送、接收结构体
  • ics-05-攻防世界
  • Web API(三)之事件流事件委托其他事件
  • SSL证书的作用是什么?
  • 皮具5G智能制造工厂数字孪生可视化平台,推进企业数字化转型
  • RH850从0搭建Autosar开发环境【3X】- Davinci Configurator之Port模块配置详解(MCAL配置)
  • 多叉树题目:子树中标签相同的结点数
  • 帝国CMS模板源码整站安装说明(图文)
  • 物联网系统未来的发展趋势
  • 基于支持 GPT 的服务的初创公司
  • 基于springboot实现教师人事档案管理系统项目【项目源码+论文说明】
  • 上行上传rsync+inotify
  • 借助ChatGPT写作:打造学术论文中的亮点与互动
  • 逐步学习Go-sync.Mutex(详解与实战)
  • 每日三道面试题之 Java并发编程 (一)
  • 车身稳定控制系统原理是什么?
  • vue3前端加载动画 lottie-web 的简单使用案例
  • 基于java+springboot+vue实现的健身房管理系统(文末源码+Lw)23-223
  • 10款白嫖党必备的ai写作神器,你都知道吗? #媒体#人工智能#其他
  • Docker工作流
  • 深入浅出 -- 系统架构之分布式集群的分类
  • Docker之镜像与容器的相关操作
  • 中科驭数超低时延网络解决方案入选2023年度金融信创优秀解决方案
  • 应用方案 | DCDC电源管理芯片MC34063A
  • 【个人使用推荐】联机不卡顿 小白一键部署 大厂云服务器选购指南 16G低至26 幻兽帕鲁最大更新来袭
  • 57 npm run build 和 npm run serve 的差异