I'm trying to block all connectivity except what's required for a SSH server to function using the following commands on a freshly installed ubuntu 18.04 server:
sudo ufw allow ssh sudo ufw default deny incoming sudo ufw default deny outgoing sudo ufw enable && sudo ufw reload
After executing the commands,
ssh remains open and firewall functions as expected. However, on reboot I get
connection refused. I believe i have used these exact commands successfully on other providers but can't get it to work for my VPS on google cloud platform. Any ideas appreciated.
- yes i'm trying to run
sshon port 22 which instantly gets refused on connection attempt