1
votes

I'm having troubles connecting to an instance on Compute Engine via SSH. If I try via command line I get the following error:

Permission denied (publickey)

The same happens if I connect via browser interactive console. In the serial port output I see:

Mar 22 14:17:04 metadata sshd[9260]: Invalid user name_lastname from xx.xx.xx.xx
Mar 22 14:17:04 metadata sshd[9260]: input_userauth_request: invalid user name_lastname [preauth]

The strange fact is that some minutes ago I didn't have any problem connecting to it and it started occurring after I have resized the instance (changed machine type from small to n1-standard-2).

The boot disk is not full and I haven't modified any user.

I've also tried to add the firewall rule but it doesn't work. I have several other machines on the same project and I can connect to them properly.

I can connect to the interactive serial console using another user previously created on the machine (manually), but I cannot become root from that.

Thanks a lot.

1

1 Answers

1
votes

You should be able to login to your instance from the serial console as root user. If you can login as root user, then you can modify the users.

If you cannot login to your instance as root user, then you should create a new instance and copy the data from the old instance to the new instance. You can do this by attaching the disk from the old instance to the new instance