I want to set up ufw on remote machine while connecting by SSH. I type
ufw reset ufw default deny incoming ufw default allow outgoing ufw allow ssh ufw allow 22 ufw enable
And after that it immediately blocks ssh connection, and does not accept new ones. The only thing I can do is to reset the server. Did I miss something?
EDIT 1: OF cause I do have ssh configured. I am accessing server by SSH. This means it is configured and that I have connection to the server until I run