Allow unmetrered connections on networking is so risky. Attacker can use the brute-force attacks to comprosise your service (or simple DOS).
Linux has a cool firewall to hanlde this, via
ip-tables. But it’s so complicated to remember all the rule and syntax. That’s why
UFW was born to save us. :D
You can use simple command to manage your firewall
$ ufw default deny incoming # deny any incoming port, should be run before allow any port