sudo ufw deny from 34.65.123.34 where 34.65.123.34 is an IP address code example Example: allow ip through ufw sudo ufw allow from 15.15.15.0/24 to any port 22