Debian 13 系统配置指南

修改静态 IP 地址

vim /etc/network/interfaces

source /etc/network/interfaces.d/*  
​
auto lo  
iface lo inet loopback  
​
allow-hotplug eno1
iface eno1 inet static  
address 192.168.2.100
netmask 255.255.255.0  
gateway 192.168.2.1

systemctl restart networking

优化 SSH 配置

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup && \
sed -i \
  -e 's/#Port 22/Port 22/' \
  -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' \
  -e 's/#GSSAPIAuthentication no/GSSAPIAuthentication no/' \
  -e 's/#UseDNS no/UseDNS no/' \
  -e 's/#ClientAliveInterval 0/ClientAliveInterval 10/' \
  -e 's/#ClientAliveCountMax 3/ClientAliveCountMax 999/' \
  /etc/ssh/sshd_config

启用并保持默认SSH端口22
允许root用户直接登录
禁用GSSAPI认证
禁用DNS反向解析,加速连接
设置客户端活动检查间隔为10秒
大幅增加客户端活动检查最大次数

systemctl restart ssh

posted @ 2026-04-07 08:52  LiuChengloong  阅读(5)  评论(0)    收藏  举报