sshgoogle-cloud-platformgoogle-compute-enginestartupscriptufw

Enabled UFW and now i can't connect to SSH


I have an Ubuntu server on google compute engine that i have allowed ufw on but forgot to allow port 22 for ssh connections and now I cannot access it

I also tried to connect using google serial console but i can't remember my instance username and password.


Solution

  • I would suggest you to run a startup script and set username/password in order to access through serial console or directly to modify the ufw writing down in the script the commands you would have used.

    Note that the startup script is run as root.