实例root与安装笔记

By | 2023-08-12

1:启用root账户开启密码登陆用到的命令:
切换到root用户:sudo -i
编辑配置文件:vim /etc/ssh/sshd_config
修改参数:
找到#PermitRootLogin, 把前面的#去掉 改成下面这样
PermitRootLogin yes

修改参数:PasswordAuthentication no改为yes

:wq保存退出

输入:passwd修改密码
reboot
重启服务器。就可以使用root用户名配合秘钥登入了

2:开启防火墙
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
apt-get purge netfilter-persistent 谨慎卸载管理 Linux 上的 iptables 防火墙规则的工具。

reboot 重启

安装软件包和更新系统
apt update -y
apt install -y curl
apt install -y socat

准备工作
域名解析到VPS 的IP 上

申请SSL证书!!!!!!!!!

安装certbot:

apt install certbot

certbot certonly —standalone -d www.hsl333.link

certbot certonly —standalone -d chat.hsl333.link

安装nginx

sudo apt-get remove —purge nginx nginx-common nginx-core
sudo apt-get autoremove
sudo apt-get install nginx

加载配置文件
systemctl reload nginx

但别随便乱用网速搜的BBR脚本,很容易搞崩!!!

echo “net.core.default_qdisc=fq” >> /etc/sysctl.conf
echo “net.ipv4.tcp_congestion_control=bbr” >> /etc/sysctl.conf
sysctl -p
lsmod | grep bbr

打完最后一步,应看到 20480 或 16384 说明BBR 开启成功

安装X-ui面板

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/956bf85bbac978d56c0e319c5fac2d6db7df9564/install.sh) 0.3.4.4