To connect a Linux VM instance, you need your own SSH key, which consists of a unique private SSH key file and a matching public SSH key file.
Due to you are generating your ssh-key via command line ssh-keygen then you must provide the Public SSH key to the instance using one of the following options:
- Use OS Login, which allows you to maintain consistent Linux user identity and avoid providing and managing SSH keys across VM instances.
- Use IAM roles to manage instance access, which allows you to provide your public SSH key to the instance through your Google account or a managed user account.
- Add SSH keys to metadata for the project or a specific instance.
- Have another user manually configure your public SSH key for you on the instance.
After you apply your public SSH key to the instances that you want to connect to, you can use your private SSH key to gain access to the instance.
In your case, seems like you need to add your Public SSH Key on the GCP Metadata (SSH Keys). You can find more details about Adding or removing project-wide public SSH Keys on this link