亚洲云linux工具箱&整理一些常用的脚本(持续更新中)

2025-02-19 605 0

亚洲云linux工具箱

功能

该脚本工具的功能是快速换源,一键安装BBR、宝塔面板等,测试服务器回程线路、IP质量、流媒体解锁以及服务器性能情况、提供多种操作菜单以实现系统、网络、文件传输等功能。以下是具体功能总结:
(AI生成的总结,如有错误或遗漏请反馈)

系统菜单

  • 重启服务器:用户可以通过该功能重启服务器,确保系统的正常运行。
  • 修改密码:提供了一键修改服务器登录密码的功能,提高安全性。
  • 同步上海时间:通过安装ntpdate同步服务器时间,确保时间的准确性。
  • 修改SSH端口:用户可以方便地更改SSH端口,增强安全性。
  • 修改DNS:支持一键修改DNS设置,提高域名解析速度。
  • 开启/关闭SSH登录:可以禁用或启用SSH登录功能,提升系统安全。
  • 更新系统版本:支持一键更新CentOS、Ubuntu和Debian等系统的最新版本,确保系统的稳定性和安全性。
  • 更换源:提供更换不同操作系统源为阿里云镜像的功能,确保软件包的更新和稳定性。
  • 创建用户和管理员:允许用户创建新用户并设置权限,满足多用户环境的管理需求。
  • 查看当前连接IP:显示当前与服务器连接的IP地址,有助于网络安全管理。
  • 修改主机名:允许用户修改服务器的主机名,便于管理和识别。

网络菜单

  • 重启网卡:重启网络接口卡,解决网络连接问题。
  • Ping测试:一键开启或关闭对指定IP的Ping测试,用于检测网络连通性。
  • 附加IP绑定:添加或删除服务器的附加IP地址,增强网络灵活性。
  • 查看地理位置:显示服务器的地理位置信息,帮助用户了解服务器的物理位置。
  • 查看原生IP:显示服务器的原始IP地址,用于网络配置和管理。
  • 检查UDP屏蔽:检测并显示是否屏蔽了UDP协议,保证数据传输的完整性。
  • VPS IP映射:将VPS的IP地址映射到独立服务器上,实现负载均衡和高可用性。
  • 四层端口转发:支持四层端口转发功能,提高内网访问外网的效率。
  • 关闭四层端口转发:一键关闭已设置的四层端口转发规则,保障网络安全。
  • 查看使用端口:列出服务器当前正在使用的端口信息,便于网络监控和管理。
  • 带宽使用情况:查看哪个IP在占用带宽,帮助优化网络资源分配。

文件菜单

  • 上传文件到远程服务器:支持一键上传本地文件到远程服务器,方便数据备份和共享。
  • 下载文件到本地:从远程服务器下载文件到本地计算机,便于数据获取和管理。
  • 硬盘分区信息查看:显示所有硬盘分区的信息,帮助用户了解存储状况。
  • 自定义挂载数据盘:允许用户自定义挂载数据盘路径,灵活管理存储空间。
  • 卸载数据盘:一键卸载已挂载的数据盘,释放存储资源。
  • 格式化数据盘:格式化选定的数据盘,准备新的数据存储环境。
  • 修复坏块:检测并修复硬盘超级坏块,延长硬盘使用寿命。
  • 设置开机启动脚本:用户可以设置开机自动执行的脚本程序,提高系统自动化管理水平。
  • 关键词内容审查:查询特定关键词的文件内容,用于内容审查和管理。
  • 清空SSH历史命令:清除SSH会话的历史记录,保护用户隐私。

宝塔菜单

  • 宝塔官方一键挂载硬盘脚本:提供官方支持的硬盘挂载脚本,简化硬盘管理过程。
  • 安装堡塔主机安全系统:一键安装堡塔主机安全系统,增强服务器安全性。
  • 安装Centos/OpenCloud/Alibaba稳定版:支持一键安装centos稳定版的宝塔产品,提升系统稳定性。
  • 安装Ubuntu/Deepin宝塔稳定版:为Ubuntu和Deepin操作系统提供宝塔产品的稳定版安装选项。
  • 安装Debian宝塔稳定版:提供Debian操作系统下的宝塔产品稳定版安装选项。
  • 安装宝塔面板最新正式版:一键安装最新的宝塔面板正式版,确保系统的现代化管理需求。
  • 一键安装宝塔WAF最新版:一键安装最新版本的宝塔Web应用防火墙(WAF),增强网站安全防护。

宿主机菜单

  • 一键开启云服务器虚拟化:该功能允许用户一键开启物理服务器的虚拟化环境,提升服务器资源的利用率和灵活性。
  • 一键自定义设置SWAP虚拟内存:用户可以自定义设置SWAP虚拟内存的大小,优化服务器的内存管理。
  • 一键关闭SWAP虚拟内存:一键禁用SWAP虚拟内存,释放物理内存资源。
  • 一键开启/关闭KSM内存回收:提供开启或关闭KSM(内核空间管理器)的功能,提高系统内存使用效率。
  • 一键关闭SELinux:一键禁用SELinux安全模块,提高系统的运行速度和灵活性。

快捷功能

  • BBR一键脚本:提供BBR优化脚本,通过调整TCP参数提升网络速度。
  • 回程路由可视化脚本:使用可视化脚本展示服务器的回程路由信息,帮助用户了解网络路径。
  • IP质量检测脚本:检测并显示服务器的IP地址质量情况,确保网络连接的稳定性。
  • 流媒体解锁检测脚本:检测并显示流媒体解锁状态,帮助用户管理流媒体服务。
  • 融合怪VPS测试一键脚本:提供一键测试VPS性能和稳定性的功能,确保VPS服务的可靠性。
  • Linux系统一键换源(默认版):一键更换Linux系统的默认软件源,提高系统更新速度和稳定性。
  • Linux系统一键换源(教育网):一键更换为EDU的软件源,提高系统更新速度和稳定性。
  • 通用一键安装宝塔最新正式版:一键安装最新版本的宝塔面板,简化宝塔产品的安装过程。

脚本

大陆服务器

curl -L https://gitee.com/krhzj/LinuxTool/raw/main/Linux.sh -o Linux.sh && chmod +x Linux.sh && bash Linux.sh

境外服务器

curl -L https://raw.githubusercontent.com/vpsad/LinuxTool/main/Linux.sh -o Linux.sh && chmod +x Linux.sh && bash Linux.sh

其他脚本列表

2023-0525 检测是否可以访问ChatGPT脚本

bash <(curl -Ls https://raw.githubusercontent.com/missuo/OpenAI-Checker/main/openai.sh)

2023-4-29 修改检测是否可以访问ChatGPT脚本

bash <(curl -Ls https://ourl.co/oaic)
bash <(curl -Ls https://cdn.jsdelivr.net/gh/missuo/OpenAI-Checker/openai.sh)

综合工具箱(强烈推荐,集成了很多脚本)

wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh

杜甫测试

wget -q https://github.com/Aniverse/A/raw/i/a && bash a
sudo apt update
sudo apt install python3-prettytable -y
bash <(wget -qO- git.io/ceshi) -j

DD相关

1、甲骨文DD脚本

DD成Debian 10
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"

DD成Ubuntu 20.04
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -u 20.04 -v 64 -p "自定义root密码" -port "自定义ssh端口"

2、MoeClub脚本

重点推荐:

时间:22/11/2021 15:21 萌咖更新脚本:

1.新增对 Oracle AMD,Oracle ARM全面支持. 可支持从 Ubuntu, Oracle Linux 等系统网络重装.
2.更新 dd 镜像的基础系统版本.
3.移除对外部 wget 的依赖.
4.新增 -port 参数, 可更改默认SSH端口.
5.更新 内置的网络参数计算 逻辑.
6.更新 grub 配置文件定位逻辑, 可支持任意引导grub的系统.

以下系统已通过测试(其他自测):
Debian: 9, 10, 11;
Ubuntu: 18.04, 20.04;
CentOS: 6.10;
以下平台已通过测试(其他自测):
Oracle、Do、Azure

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"
-d 10 -v 64
-d 9 -v 64
-u 20.04 -v 64
-u 18.04 -v 64

开机改密码脚本:

开机改密:

#!/bin/bash
echo root:Vicer |sudo chpasswd root
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo reboot

3、另一位大佬的脚本

wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh

CentOS默认密码Pwd@CentOS 其它系统Pwd@Linux
OpenVZ / LXC 架构系统不适用
来源:https://blog.hicasper.com/post/135.html

参考:https://www.ydyno.com/archives/1245.html

感谢大佬的付出!

bash <(wget --no-check-certificate -qO- 'https://file.geekn.net/CNODnjau/InstallNET.sh') -d 11 -v 64 -a -firmware


-firmware 额外的驱动支持
-d 后面是系统版本号
-v 后面写64位 32位
-a (不清楚这个干啥的但是每个脚本都带)
--mirror 后面是镜像源地址

-p 后面写自定义密码

镜像站地址
官方给出的地址列表:https://www.debian.org/mirror/list

一些国内的

ftp.cn.debian.org
mirror.bjtu.edu.cn
mirror.lzu.edu.cn
mirror.nju.edu.cn
mirrors.163.com
mirrors.bfsu.edu.cn
mirrors.hit.edu.cn
mirrors.huaweicloud.com
mirror.sjtu.edu.cn
mirrors.tuna.tsinghua.edu.cn
mirrors.ustc.edu.cn

使用方法:(大致都是一样的)

清华源
--mirror 'https://mirrors.ustc.edu.cn/debian/'

腾讯源
--mirror 'https://mirrors.aliyun.com/debian/'

阿里源
--mirror 'https://mirrors.aliyun.com/debian/'

华为源
--mirror 'https://mirrors.huaweicloud.com/debian/'

另一个DD脚本

wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh && bash InstallNET.sh -debian 11 -pwd 密码 -port 端口


4、秋水逸冰 Windows 2012/2016/2019/2022 10/11 DD 镜像


适用于 UEFI 启动的多个 Windows 系统 DD 镜像:https://teddysun.com/656.html

分别是:

Windows Server 2012 R2 Datacenter
Windows Server 2016 Datacenter (build: 14393.5006)
Windows Server 2019 Datacenter (build: 17763.2686)
Windows Server 2022 Datacenter (build: 20348.587)
Windows 10 Enterprise LTSC (build: 19044.1288)
Windows 11 Pro for Workstations 21H2 (build: 22000.194)


适用于 BIOS 启动的 Windows Server 2022 Datacenter DD 镜像:https://teddysun.com/629.html

适用于 BIOS 启动的 Windows 11 Pro for Workstations 21H2 DD 镜像:https://teddysun.com/642.html

适用于 BIOS 启动的 Windows 10 Enterprise LTSC DD 镜像:https://teddysun.com/640.html

适用于 BIOS 启动的 Windows Server 2019/2016/2012R2 Datacenter DD 镜像:https://teddysun.com/545.html

分别是:

Windows Server 2019 Datacenter(Build: 17763.2686)
Windows Server 2016 Datacenter(Build: 14393.5006)
Windows Server 2012 R2 Datacenter

测试相关

机器测试

基本测试

请出秋水的 bench.sh 脚本,这个脚本可以查看 Linux 系统信息,还可以测试网络带宽及硬盘读写速率。

wget -qO- bench.sh | bash

GeekBench
GB6 跑分脚本,附带宽测试:

curl -sL yabs.sh | bash


GB6 剔除带宽测试,因为都是国外节点测试,国内跑没多大意义:

curl -sL yabs.sh | bash -s -- -i


GB5 跑分脚本,附带宽测试:

curl -sL yabs.sh | bash -5


GB5 剔除带宽测试:

curl -sL yabs.sh | bash -s -- -i -5

来源:https://github.com/masonr/yet-another-bench-script

单线程测试

bash <(curl -Lso- https://bench.im/hyperspeed)

最全测速脚本

国内测速:

bash <(curl -sL res.yserver.ink/taier.sh)
curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast 

superbench

wget -qO- git.io/superbench.sh | bash

Bench.sh

wget -qO- bench.sh | bash

速度测试

显示延迟、抖动

bash <(wget -qO- https://bench.im/hyperspeed) 

直接显示回程线路

curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash
wget -q route.f2k.pub -O route && bash route 
# 第一个 

wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh bash testrace.sh

# 第二个
wget -qO- git.io/besttrace | bash

四网测速

wget -O jcnf.sh https://raw.githubusercontent.com/Netflixxp/jcnfbesttrace/main/jcnf.sh
bash jcnf.sh

三网测速

bash <(curl -Lso- https://git.io/superspeed_uxh)

带快速四网测试版本:

bash <(curl -Lso- https://dl.233.mba/d/sh/speedtest.sh)
bash <(curl -Lso- https://git.io/J1SEh)

测试25端口是否开放

telnet smtp.aol.com 25

测试IPv4优先还是IPv6优先

curl ip.p3terx.com

流媒体测试

全媒体测试

bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

奈飞测试

wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.5/nf_2.5_linux_amd64 && chmod +x nf && clear && ./nf
#第一个 
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

# 第二个
bash <(curl -sSL "https://github.com/CoiaPrant/MediaUnlock_Test/raw/main/check.sh")

WARP

wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/multi.sh && chmod +x multi.sh && ./multi.sh

之后进入脚本快捷方式为 bash multi.sh

服务器时间

CentOS 同步时间

yum -y install ntpdate
timedatectl set-timezone Asia/Shanghai
ntpdate ntp1.aliyun.com

BBR

CentOS 7 BBR

wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

一键开启BBR

注意:需要Linux Kernel 内核升级到 4.9 及以上版本可以实现 BBR 加速

uname -srm
输出结果:

输出结果:

Linux 3.10.0-957.12.2.el7.x86_64 x86_64

3 - 内核版本.
10 - 主修订版本.
0-957 - 次要修订版本.
12 - 补丁版本.
一般来说,Ubuntu18.04以上就可以(默认的内核4.15)
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

sysctl -p

sysctl net.ipv4.tcp_available_congestion_control

lsmod | grep bbr

Docker相关

更新、安装必备软件

apt-get update && apt-get install -y wget vim

海外服务器

非大陆Docker安装

wget -qO- get.docker.com | bash

卸载Docker

sudo apt-get purge docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

非大陆Docker-compose安装

其实现在安装了docker,默认就会安装新版的docker compose,运行命令为:docker compose,相比旧版docker-compose,少了-, 安装完docker之后可以在命令行输入docker compose --version查看docker compose的版本

旧版docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

旧版的命令为:docker-compose up -d

sudo chmod +x /usr/local/bin/docker-compose

查看版本

docker-compose --version

大陆服务器

国内机安装docker

bash <(curl -sSL https://linuxmirrors.cn/docker.sh)

或者

curl -fsSL https://bash.foreverlink.love/dockerinstall.sh | bash -s docker --mirror Aliyun

卸载docker

sudo apt-get remove docker docker-engine
rm -fr /var/lib/docker/

防火墙

CentOS 关闭防火墙

systemctl start supervisord
systemctl disable firewalld
systemctl stop firewalld

相关文章

面向AI编程:使用Claude-3.7写一个文章归档页面
使用AI为博客新增网址导航功能
一键屏蔽垃圾爬虫,包括Censys、facebook、SemrushBot、GPTbot
WordPress 条件判断标签及用法大全
curl及wget命令使用教程
Linux实现免密登录以及密钥生成方法

发布评论