Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

SSH connection issues

Here is my situation - I have been SSHing into my VM instances for years without any issue using the command:

gcloud compute ssh jackson@myservername

I just got a new macbook and I transferred everything from my old computer to my new one and I was pleasantly surprised that running that command still worked - I didn't have to do any set up. EXCEPT for one of my servers. For one of my servers when I run that command the terminal prompts for a password which it never has before. It says:

jackson@compute.6803914608257989875's password:

I have no idea what password this is referring to.

After some googling I SSH'd onto the server in the browser from within the GCP console and ran "sudo passwd" and set a new password. I restarted the server - tried SSHing again - it still asked me for a password - I entered the new one I created and it says:

Permission denied, please try again.

I have no idea if that was on the right track at all but just wanted to include what I tried.

Again - I have no problem SSHing into the other two servers and I can still SSH to the server in question on my old computer.

I'm no server expert so any insight would be greatly appreciated.

 

 

 

 

1 11 1,815
11 REPLIES 11

Have you tried to enter on these servers from serial console or directly from Google Web UI Console and tried to clear .ssh folder of the user in which you login? Let me know 🙂

Sorry for the late reply.

I cleared the .ssh folder of the user in which I login and the same thing happened.

I ran: 

gcloud compute ssh jackson@myservername

and then the terminal prompted for a password:

jackson@compute.6803914608257989875's password:  

I then ran gcloud compute ssh jackson@myservername from my old computer and I was able to SSH in successfully and a new authorized_keys file was created in my .ssh folder.

I didn't mention this in my first post but the same thing is happening with my remote desktop client, Transmit. I can still get on the server successfully from my older computer but not my new one.

I don't know why it's asking for a password, I don't know what it is, I don't know how to change it and I don't know what the "@compute.6803914608257989875" is at the end of my username when it asks for the password.

Any other ideas?

 

Hello @jackson-oomdo,

Have you tried adding the Service Account User role (roles/iam.serviceAccountUser) to your user or service account? Thanks

Hi,

Just tried it. No difference.

You can try this.

There is no ~/.ssh/config on my local computer or on the server.

On the server the only thing in ~/.ssh is the authorized_keys file and within that file it has the public key that is on my local computer in ~/.ssh

On my computer in ~/.ssh there is my public key, my private key and a filed named google_compute_known_hosts.

On my old computer if I delete the google_compute_known_hosts file and ssh into the server the terminal says:

Warning: Permanently added 'compute.6803914608257989875' (ED25519) to the list of known hosts.

Then I successfully ssh into the server and the google_compute_known_hosts file is created.

On my new computer, if I do the exact same thing the terminal says:

Warning: Permanently added 'compute.6803914608257989875' (ED25519) to the list of known hosts.

jackson@compute.6803914608257989875's password:

Once again prompts for the password. The google_compute_known_hosts file is also created.

 

I went ahead and tried the solution in the link you provided anyway and got the same result. No matter what I try - this and only this server asks for a password and no matter what I enter it says "Permission denied, please try again.".

Also, if I enter a wrong password too many times it crashes the server and I have to restart it in the GCP console.

Here is the output (I changed the server name):

jackson@Jackson ~ % gcloud compute config-ssh --remove
jackson@Jackson ~ % gcloud compute config-ssh
You should now be able to use ssh/scp with your instances.
For example, try running:

$ ssh server1.us-east1-b.my-project-name

jackson@Jackson ~ % ssh server1.us-east1-b.my-project-name
jackson@compute.6803914608257989875's password:
Permission denied, please try again.
jackson@compute.6803914608257989875's password:

If I run that command to my other servers it does not ask for a password and is successful.

Same thing happens if I run "gcloud compute ssh jackson@server1" also.

 

Hello @jackson-oomdo,

Can you confirm if you are using the latest version of Google Cloud CLI? If not, see this document to update then test your connectivity.

I updated Google Cloud CLI. Same result - for the server in question it still asks for a password. For my other servers I still successfully ssh into them.

I'm confused about the connectivity tests. The documentation offers a number of guides. Can you tell me which one applies to me?

- Test between VM instances in a VPC network
- Test between private IP addresses in a VPC network
- Test IP addresses in a Shared VPC network
- Test from a VM to a Google-managed service
- Test from a VM to Private Service Connect endpoints
- Test from an App Engine standard environment version to a destination
- Test from a Cloud Function to a destination
- Test from a Cloud Run revision to a destination
- Test from a VPC network to a non-Google Cloud network
- Test from a VM to a non-Google Cloud network
- Test from a VM or an IP address to a load balancer
- Test from a non-Google Cloud network to a VPC network
- Test from a non-Google Cloud network to a non-Google Cloud network

Did you ever figure this out? I'm facing the same issue and I'm noticing that it only effects my servers that have passphrases attached to the SSH keys. 

In my case, it's a VM that only has internal IPs so I am connecting with Identity Aware Proxy. Same as you, I'm prompted with the: username@compute.{instanceID) Password:

Would love a fix for this.

Never figured it out. I've been SSHing using GCP in the browser.