以下是Debian虚拟机的安全设置方法:
sudo apt update && sudo apt upgrade
,安装安全补丁。ufw
:sudo ufw allow 22/tcp
(SSH)、sudo ufw enable
。iptables
:手动添加规则并保存。Port 2222
),禁用 PermitRootLogin
,启用密钥认证。AllowUsers username
。sudo
组,设置强密码策略。sudo systemctl disable service-name
)。rsync
或 duplicity
)。eCryptfs
)。fail2ban
防御暴力破解,logwatch
监控日志。ClamAV
)。sysctl.conf
)。参考来源: