I am setting up ufw using ansible on a remote ubuntu server.
I am initially setting up ufw with ufw enable policy allow
to enable ssh access.
After that I'm doing ufw allow from x.x.x.x to any port 22
to allow ssh from a specific port
After that I fire in the command ufw deny ssh
to deny ssh from all other places except the above IP.
I then restart ufw services
But, this does not prevent ssh at all. I'm able to access the server from every place via ssh.
How can I block all ports after settings ufw policy to allow.
man ufw
ufw enable policy allow
though? I don't see mention of that syntax in the manpage. If you set the default incoming policy to allow first, that would take precedence.