VPS常用脚本命令
VPS常用脚本大全列表
服务器综合测试脚本(融合怪)(推荐)GitHub开源地址
curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.shbash <(wget -qO- bash.spiritlhl.net/ecs)融合脚本推荐
bash <(curl -sL https://run.NodeQuality.com)性能测试脚本
YABS(推荐)Github地址
wget -qO- yabs.sh | bash流量稀缺的服务器(不测试iperf网络)
curl -sL yabs.sh | bash -s -- -i测试geekbench5(不测试geekbench6)
curl -sL yabs.sh | bash -s -- -5geekbench5,但服务器流量稀缺(不测试geekbench6、不测试iperf网络)
curl -sL yabs.sh | bash -s -- -5 -i网络测试脚本
hyperspeed 三网测速(推荐)(未开源)
bash <(curl -Lso- https://bench.im/hyperspeed)Bench 网络带宽及硬盘读写速率(国外部分+国内部分节点)
wget -qO- bench.sh | bashSuperBench.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)欧洲速度测试
curl -sL nws.sh | bash -s -- -r eu流媒体测试脚本
ip检测脚本推荐xy
bash <(curl -sL IP.Check.Place)网络质量体检脚本(延迟)
bash <(curl -Ls https://Check.Place) -Nopenai解锁检测
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)更精确的流媒体检测脚本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 bbrLinux-NetSpeed(锐速/bbrplus/bbr魔改版)
wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.shwget -O tcpx.sh "https://github.com/ylx2016/Linux-NetSpeed/raw/master/tcpx.sh" && chmod +x tcpx.sh && ./tcpx.shbash <(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.shwget -O Swap.sh --no-check-certificate https://raw.githubusercontent.com/sunpma/cdn/master/other/Swap.sh && bash Swap.shTCP窗口调优
wget http://sh.nekoneko.cloud/tools.sh -O tools.sh && bash tools.shspiritlhl大佬的zram内存压缩脚本
curl -L https://raw.githubusercontent.com/spiritLHLS/addzram/main/addzram.sh -o addzram.sh && chmod +x addzram.sh && bash addzram.shcloudflare warp脚本 添加IPv4/IPv6网络
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.shfail2ban服务器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详细查询
curl -sL https://raw.githubusercontent.com/Yuri-NagaSaki/SICK/refs/heads/main/hardware_info.sh | bash -s -- -cn通电查询
wget 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.outDD网络重装脚本:系统默认为debian12。
moeclub大佬的脚本
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 12 -v 64 -p 密码 -port 端口 -a -firmwarewget --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 '密码'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 AliyunNezha探针 官网
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.shTrafficCop 流量监控
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.shAlist V3一键安装 [官网](https://alist.nn.ci/zh/guide/install/script.html
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s installAria2一键安装脚本
wget -N git.io/aria2.sh && chmod +x aria2.sh && bash aria2.shXUI
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.shwget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.shwget -O snell.sh --no-check-certificate https://git.io/Snell.sh && chmod +x snell.sh && ./snell.shwget -q https://raw.githubusercontent.com/passeway/Snell/main/Snell.sh -O Snell.sh && chmod +x Snell.sh && ./Snell.shrealm 转发脚本 github地址
wget https://raw.githubusercontent.com/Jaydooooooo/Port-forwarding/main/RealmOneKey.sh && chmod +x RealmOneKey.sh && ./RealmOneKey.shqbittorrent
bash <(wget -qO- https://raw.githubusercontent.com/iniwex5/Dedicated-Seedbox/main/Install.sh) 用户名 密码 1024bash <(wget -qO- https://raw.githubusercontent.com/jerry048/Dedicated-Seedbox/main/Install.sh) -u 用户 -p 密码 -c 3072 -q 4.3.9 -l v1.2.19 -xtcp调优
sudo nano /etc/sysctl.confvm.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 = 1sudo sysctl -pacme生成免费证书 教程
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.shGCP修改密码
一键脚本
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_configsed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config2、Ubuntu系统,输入以下两条命令
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_configsed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config3、重启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
EOF4、磁盘挂载
- 查看磁盘:
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來源