Linux VPS 服务器常见一键脚本整理:安装系统/更新软件/SSH 登陆/开启 BBR 等

Aliang 网络杂谈评论84字数 1651阅读模式

本文为大家整理一些常见的 Linux VPS 一键脚本,包括一键 DD 安装原版纯净系统、更新 apt 包及安装必要软件、更换软件源、禁止 SSH 密码登录并启用 SSH 密钥登录、开启 BBR、修改系统时区、安装 docker、一键测试脚本等。

一、DD 安装原版纯净系统

可以 DD 安装原版 Debian11、Debian12 或者 Ubuntu 系统文章源自测评网-https://www.cepingwang.com/395.html

Debian11文章源自测评网-https://www.cepingwang.com/395.html

 文章源自测评网-https://www.cepingwang.com/395.html

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p "YOUR_ROOT_PASSWORD" -port "YOUR_SSH_PORT"

Debian12文章源自测评网-https://www.cepingwang.com/395.html

 文章源自测评网-https://www.cepingwang.com/395.html

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 12 -v 64 -p "YOUR_ROOT_PASSWORD" -port "YOUR_SSH_PORT"

Ubuntu20.04文章源自测评网-https://www.cepingwang.com/395.html

 文章源自测评网-https://www.cepingwang.com/395.html

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -u 20.04 -v 64 -p "YOUR_ROOT_PASSWORD" -port "YOUR_SSH_PORT"

YOUR_ROOT_PASSWORD 请修改为需要设置的 Root 账号密码,YOUR_SSH_PORT 请修改为需要设置的端口号。文章源自测评网-https://www.cepingwang.com/395.html

二、更新 apt 包及安装必要软件

apt update && apt upgrade -y && apt dist-upgrade -y && apt full-upgrade -y && apt autoremove -y && apt install vim git curl screen htop vnstat net-tools dnsutils sudo

三、更换软件源

主要针对国内 VPS 主机,一般是给国内机换:文章源自测评网-https://www.cepingwang.com/395.html

 文章源自测评网-https://www.cepingwang.com/395.html

bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)

四、禁止 SSH 密码登录,启用 SSH 密钥登录

 

bash <(curl -fsSL git.io/key.sh) -og YOUR_GITHUB_USER_NAME -P SSH_PORT -d

YOUR_GITHUB_USER_NAME 请修改为自己的 Github 账号,SSH_PORT 请修改为需要设置的端口号。

五、开启 BBR

debian11 默认开启了,可以不执行。

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

六、修改系统时区

 

timedatectl set-timezone Asia/Shanghai

七、安装 docker

若不需要 Docker 可以不安装。

O- get.docker.com | bash

八、安装 python

 

sudo apt-get update && sudo apt-get install python3.6 && sudo apt-get install python3-pip

九、一键测试脚本

VPS 融合怪服务器测评脚本:

 

curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh

其他更多一键测试脚本可参考浏览本站其他教程。

声明:
本站不提供任何产品销售及代购,仅分享优惠信息,所有产品请合法使用;购买和使用中遇到的问题与本站无关,请联络相关供应商处理;资源搜集于互联网,如有侵犯你的权利,请及时联系我们删除。
联系邮箱:158698357@qq.com

 
Aliang
  • 本文由 Aliang 发表于 2024-02-23
  • 转载请务必保留本文链接:https://www.cepingwang.com/395.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定