VPS 2024-11-22
VPS Security: SSH Key Auth + Fail2ban Guide
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