Hi @Coordinador_TIC ,
Welcome to Google Cloud Community!
Here are some basic troubleshooting steps you can follow:
- Check Serial Console Output for Boot or Network Issues:
If SSH isn’t working both externally and through the GCP console, the issue may be with the OS or networking.
Check the Serial Console logs and if you see errors related to cloud-init or missing SSH keys, it may be interfering with SSH access.
gcloud compute instances get-serial-port-output --zone
- Verify SSH Keys:
Verify that the instance’s SSH configuration is correct and ensure SSH keys are properly restored in the ~/.ssh/authorized_keys file. Check the file’s permissions (should be 600) and its contents through the serial console. You can also review SSH key settings in the GCP Console under Compute Engine > VM instances > [Instance name] > SSH keys.
- Verify the instance’s network configuration:
Ensure that the instance is properly configured to use the correct subnet and network by checking the settings in the GCP Console under VPC network > Subnets and VPC network > Networks.
- Check SSH Daemon Status:
Verify if the SSH daemon is running on the new instance and, if necessary, restart it using the appropriate command for your Linux distribution.
sudo service ssh restart
or
sudo systemctl restart sshd
- Check Disk Space:
The authorized_keys file on the restored disk may be corrupted, have incorrect permissions, or lack the necessary key if you didn’t rely solely on GCP metadata keys. Corrupt disk images from snapshots can also disrupt networking or SSH configurations, and if the boot disk is damaged, the instance might fail to boot properly.
Option 1: Check the Disk via Serial Console (Replace /dev/sda1 with your actual boot partition)
sudo fsck -y /dev/sda1
Option 2: Attach Disk to a Recovery VM: Detach the boot disk from the non-working instance, attach it to another VM, then mount and inspect the logs for issues.
sudo mkdir /mnt/recovery
sudo mount /dev/sdb1 /mnt/recovery
cat /mnt/recovery/var/log/syslog | grep ssh
If you need further assistance, you can reach out to Google Cloud Support at any time.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.