I recently upgraded laptops and decided to update the SSH key I use to connect to our server. I updated the public key in GCP console, but I can't SSH in. Other team members are able to log in fine.
I have the new keypair in .ssh/ and the permissions should be fine, drwx------ for the dir, -rw------- for the private key and -rw--r-r-- for the public key. I can see from the ssh -v log that it's attempting and offering the correct key. The username and its public key in Google cloud console are correct.
We have restarted the VM instance after updating the keys in the console. As other team members are able to log in, the issue looks to be at my end, not at the server. I'm on macOS Catalina.
Any ideas?
11 Answer
I was trying to figure this out, and just for kicks tried my old key, and it worked. This is strange since I removed the old key from GCP console several weeks ago, and the public key I can see there is the new one. I also checked my authorized_keys and it includes the old public key. So, the keys visible in the GCP console are not in sync with the reality of the VM OS. Why this happens and how to remedy it is an another question, but this resolves the original problem.