VPS常用脚本命令

VPS常用脚本大全列表

服务器综合测试脚本(融合怪)(推荐)GitHub开源地址

curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
bash <(wget -qO- bash.spiritlhl.net/ecs)

性能测试脚本

YABS(推荐)Github地址

wget -qO- yabs.sh | bash

流量稀缺的服务器(不测试iperf网络)

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

测试geekbench5(不测试geekbench6)

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

geekbench5,但服务器流量稀缺(不测试geekbench6、不测试iperf网络)

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

Geekbench 5 专测脚本 Github地址

bash <(curl -sL bash.icu/gb5)
bash <(wget -qO- https://raw.githubusercontent.com/i-abc/GB5/main/gb5-test.sh))

LemonBench Github地址

wget -qO- https://raw.githubusercontent.com/LemonBench/LemonBench/main/LemonBench.sh | bash -s -- --fast

UnixBench.sh

wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh && chmod +x unixbench.sh && ./unixbench.sh

网络测试脚本

hyperspeed 三网测速(推荐)(未开源)

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

AutoTrace 三网回程线路显示(推荐)

wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh

backtrace 三网回程线路直接显示(小白用这个)

curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh

Bench 网络带宽及硬盘读写速率(国外部分+国内部分节点)

wget -qO- bench.sh | bash

SuperBench.sh 网络带宽及硬盘读写速率(国内三网+speedtest+fast)

wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash

网络专测 Github地址

bash <(curl -sL bash.icu/speedtest)
bash <(curl -sL https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh)

一键测试 vps 到各省回程线路

bash <(curl -sL https://raw.githubusercontent.com/LiMeet/vpshell/refs/heads/main/autoNxTrace_allsf.sh)

欧洲速度测试

curl -sL nws.sh | bash -s -- -r eu

流媒体测试脚本

RegionRestrictionCheck(推荐)

bash <(curl -L -s check.unlock.media)

流媒体解锁改(加入了原生/DNS解锁检测)

bash <(curl -L -s media.ispvps.com)

openai解锁检测

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

准确度最高

bash <(curl -L -s https://github.com/1-stream/RegionRestrictionCheck/raw/main/check.sh)

ip检测脚本推荐

bash <(curl -sL IP.Check.Place)

更精确的流媒体检测脚本Github地址

bash <(curl -L -s https://github.com/1-stream/RegionRestrictionCheck/raw/main/check.sh)

BBR脚本

一键开启BBR(适用于较新的Debian、Ubuntu)

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

Linux-NetSpeed(锐速/bbrplus/bbr魔改版)

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

ylx大佬的锐速/BBRPLUS/BBR2

wget -O tcpx.sh "https://github.com/ylx2016/Linux-NetSpeed/raw/master/tcpx.sh" && chmod +x tcpx.sh && ./tcpx.sh

jerry048系统优化脚本

bash <(wget -qO- https://raw.githubusercontent.com/jerry048/Tune/main/tune.sh) [选项]

选项说明:

  • -a: 启动自动更新。
  • -b: 设置带宽限制。
  • -c: 设置CPU滥用自动关机。
  • -d: 启动DDoS自动关机。
  • -s: 进行SSH安全设置。
  • -t: 执行系统调优。
  • -x: 安装BBRx。
  • -3: 安装BBRv3。
  • -h: 显示帮助信息。

moerats大佬的添加swap脚本

wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh
wget -O Swap.sh --no-check-certificate https://raw.githubusercontent.com/sunpma/cdn/master/other/Swap.sh && bash Swap.sh

TCP窗口调优

wget http://sh.nekoneko.cloud/tools.sh -O tools.sh && bash tools.sh

spiritlhl大佬的zram内存压缩脚本

curl -L https://raw.githubusercontent.com/spiritLHLS/addzram/main/addzram.sh -o addzram.sh && chmod +x addzram.sh && bash addzram.sh

cloudflare warp脚本 添加IPv4/IPv6网络

wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh

fail2ban服务器ssh防爆破

wget https://raw.githubusercontent.com/FunctionClub/Fail2ban/master/fail2ban.sh && bash fail2ban.sh 2>&1 | tee fail2ban.log

独立服务器硬盘时间

wget -q https://github.com/Aniverse/A/raw/i/a && bash a

超售测试脚本

一键检测超售 LOC帖

wget --no-check-certificate -O memoryCheck.sh https://raw.githubusercontent.com/uselibrary/memoryCheck/main/memoryCheck.sh && chmod +x memoryCheck.sh && bash memoryCheck.sh

移除virtio_balloon模块

rmmod virtio_balloon

内存填充测试

apt-get update
apt-get install wget build-essential -y
wget https://raw.githubusercontent.com/FunctionClub/Memtester/master/memtester.cpp
gcc -l stdc++ memtester.cpp
./a.out

DD网络重装脚本:系统默认为debian12。

moeclub大佬的脚本

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 12 -v 64 -p 密码 -port 端口 -a -firmware

leitbogioro大佬的脚本(推荐)

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 12 -pwd '密码'

beta.gs大佬的脚本

wget --no-check-certificate -O NewReinstall.sh https://raw.githubusercontent.com/fcurrk/reinstall/master/NewReinstall.sh && chmod a+x NewReinstall.sh && bash NewReinstall.sh

我想DD成Linux系统的(推荐、首选) 强烈建议使用leitbogioro大佬的 512M内存以上的成功率高达100%。且可以自动配置ipv6

bash <(curl -sSL https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh) -debian 10 -timezone "Asia/Shanghai" -swap "1024"

密码LeitboGi0ro

5k哥的脚本 写好的教程 风险警告:此人口碑不良

常用软件脚本

Docker(已默认安装docker compose)

curl -fsSL https://get.docker.com | bash -s docker

国内docker安装:

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

Nezha探针 官网

curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh

TrafficCop 流量监控

sudo apt update && curl -H "Accept: application/vnd.github.v3.raw" -fsSL "https://api.github.com/repos/ypq123456789/TrafficCop/contents/trafficcop.sh" | tr -d '\r' > /root/traffic_monitor.sh && chmod +x /root/traffic_monitor.sh && bash /root/traffic_monitor.sh

Alist V3一键安装 [官网](https://alist.nn.ci/zh/guide/install/script.html

curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install

Aria2一键安装脚本

wget -N git.io/aria2.sh && chmod +x aria2.sh && bash aria2.sh

XUI

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)

Xray

wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh

mack-a 一键脚本

wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh

Snell脚本推荐

wget -O snell.sh --no-check-certificate https://git.io/Snell.sh && chmod +x snell.sh && ./snell.sh

Snell脚本

wget -q https://raw.githubusercontent.com/passeway/Snell/main/Snell.sh -O Snell.sh && chmod +x Snell.sh && ./Snell.sh

realm 转发脚本 github地址

wget https://raw.githubusercontent.com/Jaydooooooo/Port-forwarding/main/RealmOneKey.sh && chmod +x RealmOneKey.sh && ./RealmOneKey.sh

qbittorrent

bash <(wget -qO- https://raw.githubusercontent.com/iniwex5/Dedicated-Seedbox/main/Install.sh) 用户名 密码 1024
bash <(wget -qO- https://raw.githubusercontent.com/jerry048/Dedicated-Seedbox/main/Install.sh) -u 用户 -p 密码 -c 3072 -q 4.3.9 -l v1.2.19  -x

tcp调优

sudo nano /etc/sysctl.conf
vm.swappiness=1
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 212992 16777216
net.ipv4.tcp_wmem=4096 212992 16777216
net.ipv4.tcp_window_scaling = 1
sudo sysctl -p

acme生成免费证书 教程

curl https://get.acme.sh | sh

聚合一键脚本 地址 可以开小鸡

curl -fsSL https://raw.githubusercontent.com/eooce/ssh_tool/main/ssh_tool.sh -o ssh_tool.sh && chmod +x ssh_tool.sh && ./ssh_tool.sh

科技lion一键脚本工具

curl -sS -O https://raw.githubusercontent.com/kejilion/sh/main/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh

GCP修改密码

一键脚本

wget -q root.sh https://raw.githubusercontent.com/passeway/root/main/root.sh && chmod +x root.sh && ./root.sh

详细说明:
脚本会根据用户选择,生成随机密码或者设置自定义密码,并将其应用于root用户。
脚本会修改SSH服务器的配置文件以允许root用户登录和使用密码进行身份验证,并重启SSH服务以应用更改。
最下面附该shell命令

其他方式

  • 先选择从浏览器打开ssh连接服务器
  • 切换到root账号,输入代码:sudo -i
  • 设置root密码,输入代码:passwd 然后会要求输入新密码,然后再重复一次密码,输入密码的时候不会显示出来,所以直接输入密码,然后回车,再然后重复输入密码回车 开启SSH权限 、CentOS和Debian通用,输入以下两条命令
sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config

2、Ubuntu系统,输入以下两条命令

sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config

3、重启ssh,输入命令:sudo systemctl restart sshd

ipv6机器

更新 resolv.conf 文件

cat >/etc/resolv.conf <<EOF
nameserver 2001:67c:2b0::4
nameserver 2001:67c:2b0::6
EOF

无法访问github 修改host

cat >> /etc/hosts << EOF
# https://danwin1210.de/github-ipv6-proxy.php
2a01:4f8:c010:d56::2 github.com
2a01:4f8:c010:d56::3 api.github.com
2a01:4f8:c010:d56::4 codeload.github.com
2a01:4f8:c010:d56::5 objects.githubusercontent.com
2a01:4f8:c010:d56::6 ghcr.io
2a01:4f8:c010:d56::7 pkg.github.com npm.pkg.github.com maven.pkg.github.com nuget.pkg.github.com rubygems.pkg.github.com
EOF

4、磁盘挂载

  • 查看磁盘:fdisk -l
  • 将磁盘格式化:sudo mkfs.ext4 /dev/vdb
  • 添加权限:chmod -R 777 /data
  • 挂载磁盘:mount /dev/vdb /data/
  • 查看磁盘uuid:blkid
  • 自动挂载:echo UUID=6ca74afd-ace3-4b26-af7a-d39b4b5cd711 /data ext4 defaults 0 0 >> /etc/fstab 來源
0%