UFW is an interface of iptables ... use the command sudo ufw allow 22. If you're having issues, reset the firewall to its default state with sudo ufw reset. Ubuntu's firewall is a basic yet ...