Unable to SSH to instance

2,205 views
Skip to first unread message

Heng Yong Sheng

unread,
May 26, 2021, 10:21:29 AM5/26/21
to gce-discussion
Hi, 

I am unable to SSH into my instance and here is what I see on the serial console.
Does anyone know how to resolve this?


May 26 06:55:43 instance2 GCEGuestAgent[456]: 2021-05-26T06:55:43.5426Z GCEGuestAgent Info: Adding existing user myid to google-sudoers group.

May 26 06:55:43 instance2 GCEGuestAgent[456]: 2021-05-26T06:55:43.5622Z GCEGuestAgent Info: Updating keys for user myid.

May 26 06:55:43 instance2 GCEGuestAgent[456]: 2021-05-26T06:55:43.5623Z GCEGuestAgent Error non_windows_accounts.go:158: Error updating SSH keys for myid: open /home/myid/.ssh/authorized_keys.google: file exists.


Thanks.

rezaizadi

unread,
May 27, 2021, 12:22:38 PM5/27/21
to gce-discussion

Hi,

From the given logs, it seems like the error is from the guest agent[1]. if you could move the authorized_keys.google file out of /.ssh/ and to another temporary location for the user who is facing this error and try it again may resolve the issue .

Currently as the file is already available in the location, it is not allowing to create a temporary file to eventually update keys for the user. So maybe moving the authorized_keys.google file out of /.ssh/ and to another temporary location may help.

Please keep in mind to do this only for the user who is facing the error and not all the users.

[1]https://github.com/GoogleCloudPlatform/guest-agent#account-management

Heng Yong Sheng

unread,
May 27, 2021, 2:30:01 PM5/27/21
to gce-discussion
Thanks for your suggestion.

I have actually went ahead to re-create a fresh instance for myself, but I will try this if the issue occurs again in the future. 

May I ask, how can I move the file out without having the ability to ssh in?

Ruben (Google Cloud Support)

unread,
Jun 3, 2021, 11:09:57 AM6/3/21
to gce-discussion

Hello, 

You can connect via serial console as indicated in this documentation [1].

Have a nice day!

Reply all
Reply to author
Forward
0 new messages