I am about to configure firewall with UFW. I am logged in over SSH so I don't know if the terminal will be locked out as soon as I do:
sudo ufw default deny incoming
If so, how can I deny all incoming (lock the whole thing down) except SSH and do it all in the same command?