[toc]
DD成debian11脚本(root用户运行)
1.debi.sh脚本
- 下载脚本:
curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && chmod a+rx debi.sh
- 运行脚本:
./debi.sh --cdn --network-console --ethx --bbr --user root --password <新系统用户密码>
--bbr
开启 BBR--ethx
网卡名称使用传统形式,如eth0
而不是ens3
--cloud-kernel
安装占用空间较小的cloud
内核,但可能会导致 UEFI 启动的机器(如 Oracle、Azure 及 Hyper-V、Google Cloud 等)VNC 黑屏。BIOS 启动的普通 VPS 则没有此问题。- 默认时区为 UTC,添加
--timezone Asia/Shanghai
可使用中国时区。 - 默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加
--china
可使用阿里云镜像源。
- 如果没有报错可以重启:
shutdown -r now
2.moeclub脚本(DD成debian11)
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p "abcd123456" -port "22"
DD成功后,可为新机子安装一些常用的软件
apt install curl sudo net-tools wget dnsutils -y
升级内核至5.16(可选,仅限X86)
1.下载内核
Debian:
curl 'https://liquorix.net/add-liquorix-repo.sh' | sudo bash
Ubuntu :
sudo add-apt-repository ppa:damentz/liquorix && sudo apt-get update
2.安装内核
sudo apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64
3.重启系统
reboot
BBR优化相关(基于原版bbr,可选)
- 运行如下代码:
cat > /etc/sysctl.conf <<EOF
fs.file-max = 1048576
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.ipv4.tcp_mem = 25600 51200 102400
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.core.somaxconn = 10240
net.core.default_qdisc = fq
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_congestion_control = bbr
EOF
- 然后运行如下代码使配置生效:
sysctl -p && sysctl --system
SS相关
一键ss脚本:
作者仓库:https://github.com/loyess/Shell
wget -N --no-check-certificate -c -t3 -T60 -O ss-plugins.sh https://git.io/fjlbl
chmod +x ss-plugins.sh
./ss-plugins.sh
一键搭建vmess/vless
作者仓库:https://github.com/mack-a/v2ray-agent
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
再次使用脚本可以输入vasma
,内置一些实用功能,比如更换bbr内核
端口转发相关
一键gost脚本
作者仓库:https://github.com/KANIKIG/Multi-EasyGost
wget --no-check-certificate -O gost.sh https://raw.githubusercontent.com/KANIKIG/Multi-EasyGost/master/gost.sh && chmod +x gost.sh && ./gost.sh
- 选1 先安装gost
选n,国外机不需使用大陆镜像 - 再次运行脚本
./gost.sh
如果只需要搭建ss,选4即可
设置好密码,加密方式,端口后即可使用
加密方式建议选 aead-chacha20-poly1305
一键socat管理脚本
wget -N --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/socat.sh && chmod +x socat.sh && bash socat.sh
流媒体检测
来源 https://github.com/lmc999/RegionRestrictionCheck
bash <(curl -L -s check.unlock.media) -M 4 \\仅测试ipv4
bash <(curl -L -s check.unlock.media) -M 6 \\仅测试ipv6
VPS综合测试
curl -sL yabs.sh | bash
如果想要跳过iperf测试 可用
curl -sL yabs.sh | bash -s -- -i
三网测速
多线程测速
bash <(curl -sSL "https://github.com/CoiaPrant/Speedtest/raw/main/speedtest-multi.sh")
单线程测速
bash <(curl -sSL "https://github.com/CoiaPrant/Speedtest/raw/main/speedtest-single.sh")
其他脚本
1. 显示当前系统信息
wget https://raw.githubusercontent.com/lamysafari88/vpsbox/main/nhfetch.sh && bash nhfetch.sh install
效果如下
卸载命令
wget https://raw.githubusercontent.com/lamysafari88/vpsbox/main/nhfetch.sh && bash nhfetch.sh uninstall
给VPS 配置 SSH 密钥免密登录
1.生成密钥对
在远程SSH上输入ssh-keygen
一路回车即可
2.安装公钥
cd .ssh/
cat id_rsa.pub >> authorized_keys # 将公钥写入到 authorized_keys 文件
3.修改权限
chmod 600 authorized_keys
chmod 700 ~/.ssh
然后记得把~/.ssh
下里面的文件都拷到本地
4.修改sshd配置文件
编辑/etc/ssh/sshd_config
找到如下两项,修改成yes
RSAAuthentication yes
PubkeyAuthentication yes
5.重启sshd服务
在你确认能使用密钥文件id.rsa
能成功登录后,
如果需要禁用密码登录,请更改以下参数:
编辑/etc/ssh/sshd_config
PasswordAuthentication no
然后:
service sshd restart
退出screen窗口:
按住ctrl 先按a 再按d
修改ipset
nano /etc/dnsmasq.d/warp.conf
然后 systemctl restart dnsmasq
debian10 更新内核至5.10(不分ARM和X86)
参考:https://p3terx.com/archives/debian-linux-vps-server-wireguard-installation-tutorial.html
1、添加 backports 源
echo "deb http://deb.debian.org/debian $(lsb_release -sc)-backports main" | sudo tee /etc/apt/sources.list.d/backports.list
sudo apt update
uname -r
此时看到的版本应该是4.19的,为了之后安装warp方便,我们可以更新内核到新版,5.6以上就自带了wireguard了,现在最新的是5.10
sudo apt -t $(lsb_release -sc)-backports install linux-image-$(dpkg --print-architecture) linux-headers-$(dpkg --print-architecture) --install-recommends -y
安装完重启,执行 uname -r 命令,现在已经是5.10了。
评论 (0)