Since I received a email warning letter from google says "Action required: Critical problem with My First Project" saying my server has some abnormal outgoing activity , I tried to implemented ufw in my debian server.
For my ufw setting, I've done the following:
sudo ufw default deny incoming
sudo ufw default deny outgoing
sudo ufw allow ssh
sudo ufw allow 22
sudo ufw allow http
sudo ufw allow https
After I restart my server , I can't connect to my server with the error "Connection Failed: We are unable to connect to the VM on port 22. Learn more about possible causes of this issue."
I followed the following instruction https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-ssh but it still not working:
I found the correct answer in this website. https://www.jhanley.com/google-cloud-recovering-from-ufw-lockout/
Method 2 in the website solves this problem