Biomed 大佬有话说 :
vps到手后的首要操作
本帖最后由 Biomed 于 2020-7-20 15:53 编辑
和各位mjj分享交流一下,小鸡到手后的首要操作,我喜欢用Debian系的操作系统,以下以Debian为例。
0. 升级系统或更换系统
不支持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的则不然。
1. 安装基本软件
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
2.优化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
3.美化终端
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
4.安全加固
已经有人发过帖子,我就不赘述了,大概就几步,更换ssh端口,开启防火墙,安装fail2ban
https://www.hostloc.com/thread-711548-1-1.html
5. 性能测试
wget -qO- git.io/superbench.sh | bash
以及路由去程回程测试,用besttrace测的。
6.删机跑路(可选)
rm -rf /*
确保是root登录,不是的话,命令行前加上sudo
至此,一台稳定好用的小鸡配置完毕:lol
绿豆 大佬有话说 :
我先DD Debian
CO2 大佬有话说 :
到手就测一下速,然后吃灰
baidns 大佬有话说 :
6.删机跑路(可选)
Erik 大佬有话说 :
其他代码太复杂,只记住了rm -rf /*
不错yc017t
cmm 大佬有话说 :
mark一下
merloat 大佬有话说 :
真能水,最首要的安全加固不说:lolhttps://cdn.jsdelivr.net/gh/hishis/forum-master/public/images/patch.gif
qinghe187100 大佬有话说 :
不是应该是跑开心脚本-删机-退款吗
b66667777 大佬有话说 :
6.操作 好评:lol
remarkable 大佬有话说 :
最后那个命令不错,前面都弄过后删除一下垃圾文件:lol:lol:lol