Moving SSH from port 22 to a custom port (e.g., 2244) stops 99% of automated bot scans.
- Allow the new port in your firewall first:
sudo ufw allow 2244/tcp. - Edit
/etc/ssh/sshd_configand setPort 2244. - Restart SSH:
sudo systemctl restart ssh(orsshd). - Test in a second terminal before closing your active session:
ssh -p 2244 root@YOUR_VPS_IP.