VPS 2024-11-22
VPS 安全加固:SSH 密钥认证 + Fail2ban 全攻略
1. SSH 密钥登录
ssh-keygen -t ed25519 -C "your@email.com"
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server编辑 /etc/ssh/sshd_config,设置 PasswordAuthentication no,重启 SSH。
2. Fail2ban
sudo apt install fail2ban -y
sudo systemctl enable fail2ban --now
#Sudofree#Fail2ban