I have edited the sshd_config file of my instance (Google Cloud Platform) to change port 22 to a new port. Add a new firewall rule for the port, but now I can't connect neither to 22 or to the port that I have configured. Nor can I access through the serial port. Anyone know any alternative to access the instance, or any option to not lose all my settings (databases, etc)
Create an ingress VPC firewall rule to allow the different ssh port.
Snapshot the broken instance's disk. Start a backup from this snapshot, just in case. Create a new disk from this snapshot and attach it as an additional disk to a working VM.
On the temporary instance, mount the copy of the broken disk. Edit sshd_config and any host firewalls. Test the sshd_config by starting another daemon with
Restore the fixed disk to an instance.