学习/ 220 阅读 阅读时间 8 分钟

DD Debian 13 后的系统设置优化一键脚本

之前一直使用天权璇玑的一键 DD 脚本,但是应该是作者挺忙的,项目页面近 1 年都没有更新和维护,最近 Debian 13 上线后,虽然脚本也可用,但我自己测试下来,在已经是 Debian 13 的情况下,再次 DD Debian 13 会容易出现失联的情况。

而另一个使用比较广泛的 煎饼佬的 DD 脚本就在 13 出来的同时,就对 Debian 13 做了更新支持。

DD 脚本项目地址

https://github.com/bin456789/reinstall

一键 DD 脚本

curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh && bash reinstall.sh debian 13 --ssh-port 12345 --password woshimima && reboot

DD 脚本的系统版本、 ssh 端口和 password 可自行修改(ssh 端口和 root 密码不要使用脚本默认)。

因为这个 DD 脚本在使用时的可自定义参数不多,只能指定 ssh 端口和密码,所以我又写了一个自用的系统优化一键设置脚本,方便在 DD 系统后按照个人需求一键优化系统。

自用系统优化设置项目地址

https://github.com/yahuisme/vps-setup

项目特点

一键配置脚本

apt-get update -y && apt-get install -y curl && bash <(curl -fsSL https://raw.githubusercontent.com/yahuisme/vps-setup/main/install.sh)

脚本默认配置:

默认不执行系统升级和清理。

无交互自定义

apt-get update -y && apt-get install -y curl && curl -fsSLo install.sh https://raw.githubusercontent.com/yahuisme/vps-setup/main/install.sh && chmod +x install.sh && ./install.sh --hostname "hostname" --timezone "Asia/Hong_Kong" --swap 1024 --bbr --ip-dns "94.140.14.14 1.1.1.1" --ip6-dns "2a10:50c0::ad1:ff 2606:4700:4700::1111" --ssh-port 12345 --fail2ban --non-interactive

参数

--hostname <name> 设置主机名
--timezone <tz> 设置时区
--swap <auto|MB|0> 设置 Swap;0 表示禁用全部 Swap
--ip-dns "主DNS 备用DNS" 设置 IPv4 DNS
--ip6-dns "主DNS 备用DNS" 设置 IPv6 DNS
--bbr 启用 BBR
--no-bbr 禁用 BBR
--fail2ban 启用 Fail2ban,保护 SSH
--no-fail2ban 禁用 Fail2ban
--ssh-port <port> 设置 SSH 端口
--ssh-password <pass> 设置 root 密码
--upgrade 执行系统 full-upgrade
--cleanup 执行 autoremove 和 apt clean
--non-interactive 非交互模式
-h, --help 显示帮助

注意

最后更新:2026-08-27
标签

讨论

1 条评论

写评论

写下评论