以下是Debian虚拟机的安全配置要点:
sudo apt update && sudo apt upgrade,安装安全补丁。ufw(推荐):sudo ufw enablesudo ufw allow 22/tcp(若需SSH,默认端口,建议修改为非标准端口)。iptables:手动配置规则并保存至 /etc/iptables/rules.v4,设置开机加载。Port 2222),禁用 PermitRootLogin(设为 no),启用密钥认证(PasswordAuthentication no)。/etc/ssh/sshd_config 中添加 AllowUsers your_username。sudo 组:sudo adduser username + sudo usermod -aG sudo username。/etc/pam.d/common-password 设置密码规则。systemctl disable <服务名>)。rsync 或 duplicity 工具。eCryptfs 或 EncFS。logwatch 或 fail2ban 监控异常登录。/var/log/ 目录)。telnet)。ClamAV)。配置前建议备份重要数据,配置后测试系统功能确保正常运行。