Today ssh to my GCP VM stopped working. This has been working for over a year. This is what I see:
ssh -i /home/joe/.ssh/google_compute_engine.pub [(PII Removed by Staff)@test.myserver.comtest.myserver.com](mailto:(PII @test.myserver.comemoved by Staff)@test.myserver.com)
(PII Removed by Staff)@test.myserver.com: Permission denied (publickey).
I ran ssh with verbose output and I see:
ssh -i /home/joe/.ssh/google_compute_@test.myserver.comngine.pub [(PII Removed by Staff)@test.myserver.com)@test.myserver.com](mailto:(PII Removed by Staff)@test.myserver.com) -v -v -v
…snip many lines above…
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug3: ssh_get_authentication_socket_path: path ‘/run/user/1000/keyring/ssh’
debug1: get_agent_identities: ssh_get_authentication_socket: Connection refused
debug1: Will attempt key: /home/paul/.ssh/google_compute_engine.pub RSA SHA256:lw/mY…snip…vY explicit
debug2: pubkey_prepare: done
debug1: Offering public key: /home/joe/.ssh/google_compute_engine.pub RSA SHA256:lw/mM…snip…yvY explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /home/joe/.ssh/google_compute_engine.pub RSA SHA256:lw…snip…vY @openssh.comxplicit
debug3: sign_and_send_p@openssh.combkey: using [(PII Removed by Staff)@openssh.com](mailto:(PII Removed by Staff)@openssh.com) with RSA SHA256:lw/m…snip…yvY
debug3: sign_and_send_pubkey: signing using rsa-sha2-256 SHA256:lw/m…snip…GyvY
Load key “/home/joe/.ssh/google_compute_engine.pub”: error in libcrypto
debug2: we did not send a pac@test.myserver.comet, disable method
debug1: No more authentication methods to try.
[(PII Removed by Staff)@test.myserver.com](mailto:(PII Removed by Staff)@test.myserver.com): Permission denied (publickey).
I tried getting a ssh connection from the GCP dashboard using the OPEN IN WEB BROWSER option, but that fails with the same error. When I tried the ssh troubleshooting tool that was offered all I saw was:
Troubleshooting your connection
3 of 3 tests complete
VM status: OK
Network status: Test skipped
IAM permissions: Test skipped
Luckily I am able to get on the server like this:
gcloud compute ssh --zone “us-west1-f” “test-vm” --project “(PII Removed by Staff)”
On the VM I looked in the ssh log file /var/log/auth.log and saw this entry for my failed attempt and I see this:
2025-11-05T23:14:04.181237+00:00 test-vm sshd[3667611]: Connection closed by authenticating user joe 76.xx.xx.123 port 38228 [preauth]
I checked my SSH firewall rule and it has not changed.
My ssh key has not changed either.
The only thing that has changed recently is I added a new ssh public key for another user to the project-wide metadata. And that key was working for ssh’ing to the server.
I am at a loss as to what to check.