融合怪测试
curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
安装docker
curl -fsSL https://get.docker.com | bash -s docker
安装??面板
bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)
开启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
设置密钥登录
备份原sshd配置文件
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
创建SSH密钥对
ssh-keygen
输入保存密钥文件的路径,使用默认/root/.ssh/地址回车即可
输入密钥文件的密码(可不输入,直接回车)
出现以下输出说明生成成功
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
服务端配置公钥
cd /root/.ssh
cat id_rsa.pub >> authorized_keys
更改权限,更改authorized_keys文件和目录的权限,600对应的是-rw——-,代表只有文件所有者具有读写权限。700对应的是-rwx——,代表文件或目录所有者有读写和执行权限
chmod 600 authorized_keys
chmod 700 ~/.ssh
编辑ssh配置文件
nano /etc/ssh/sshd_config
在文件中添加以下四行(找到对应的内容修改也行,我懒得找)
RSAAuthentication yes
PubkeyAuthentication yes
PermitRootLogin yes
Port 12345 #这个是修改端口,可不改
重启ssh服务
systemctl restart sshd
放行SSH登录端口(某些VPS需要)
iptables添加SSH新端口规则:
iptables -A INPUT -p tcp --dport 12345 -j ACCEPT #12345替换为新的端口#
然后保存iptables规则
firewalld添加SSH新端口规则:
firewall-cmd --permanent --zone=public --add-port=12345/tcp #12345替换为新的端口#
firewall-cmd --reload #重载firewalld#
测试密钥登陆是否成功
密钥登陆成功后禁止密码登陆
nano /etc/ssh/sshd_config
新增一行(找到对应的内容修改也行,我懒得修改)
PasswordAuthentication no
安装Portainer(管理docker容器用,神器)
docker run -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
前排支持
支持
一波流
雖然手殘,但好貼要頂一下
bd
好帖
帮顶
前排支持
支持
厉害了