sudo ufw allow from 198.51.100.0/24 to any port 22 proto tcp comment 'office ssh'
Restrict SSH to an office IP range
Whitelists only the 198.51.100.0/24 subnet for SSH, so logins from anywhere else are refused at the firewall — stronger than rate limiting alone. The full-rule syntax adds from (source) and to (destination) with an optional comment. Combine with a deny-by-default incoming policy for a locked-down box.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.