作为一个资深的小鸡玩家,你一点要知道的小鸡到手后的首要操作。本人喜欢用Debian系的操作系统,所以本教程以Debian为例。
1、升级系统或更换系统,不支持Debian的就自行dd一个。
- wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh
- # 默认密码Pwd@Linux
- apt update
- apt full-upgrade -y
- (以下可选,Debian9升级至Debian10)
- sed -i 's/stretch/buster/g' /etc/apt/sources.list
- apt update
- apt full-upgrade -y
用最新版操作系统,有诸多好处,比如性能上的提升,更便捷的操作,更多软件支持,更多新特性等等,举个例子,大家都知道某些基于tls加密的web服务器或反向代理服务器,比如nginx,用tls1.3速度和安全性会有较大提升,而Debian10用apt默认安装nginx就支持tls1.3,Debian9的则不然。
2、安装基本软件
- apt install wget curl htop vim zsh unzip man ufw fail2ban certbot nginx speedtest-cli python3 python3-pip openssl cron socat curl git aria2 -y
- pip3 install requests bs4 lxml python-telegram-bot you-get 有图比-dl
3、优化tcp传输(即开启bbr)
- 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
4、美化终端
- sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- git clone https://github.com/zsh-users/zsh-autosuggestions ${ ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- zsh-autosuggestions zsh-syntax-highlighting
5、安全加固
大概就几步,更换ssh端口,开启防火墙,安装fail2ban。
6、性能测试
- wget -qO- git.io/superbench.sh | bash