1

I recently formatted my system, I thought better to create new SSH for login into the system from the Local system.

Steps I followed :

  1. Remove all previous keys to VM leaving one Key, which is user_name.
  2. Tried connecting to In Browser SSH it started failing, I tried rebooting VM Nothing works. 3.Then copied previously all SSH keys from backups into my local system just to make connection and working side by not affecting my development. 4.Added new SSH Keys in VM Instance Project Wide SSH keys, tried logging into VM Instance from the local system, Successfully.
  3. Tried with google-cloud SDK using previous key Successful.
  4. But Browser SSH is still failing.
  5. ~/ssh/authroized_keys there are keys which I added for automatic deployment.

Problems which I detected : 1. After the following troubleshooting from google, when I tried login using fresh user it's failed.

gcloud compute ssh test@vh-server
Updating project ssh metadata.../Updated [https://www.googleapis.com/compute/v1/projects/project-name].
Updating project ssh metadata...done.                                                    
Waiting for SSH key to propagate.
Permission denied (public key).
ERROR: (gcloud.compute.ssh) Could not SSH into the instance.  It is possible that your SSH key has not propagated to the instance yet. Try running this command again.  If you still cannot connect, verify that the firewall and instance are set to accept ssh traffic.
  1. New SSH login using new public and a private key is also failing. I created new keys, updated SSH keys in VM instance.

    ssh -i ~/.ssh/my-ssh-key test@ip_address ssh: connect to host ip_address port 22: Operation timed out

  2. No In Browser SSH Login.

I followed this question no help Not able to browser login

Any Help would be appreciated

Problem : -

I am not able to do in browser SSH Connection

  • You can ssh to the instance using your existing keys and make sure GCE daemon scripts are running on the VM, specially Accounts script. This script is responsible to sync user account and ssh keys from metadata server to the instance. – Faizan Sep 6 '17 at 16:06
  • This cloud be an issue related to old GCE daemons installed on your VM. You can follow the steps on this link to update the repositories on your VM and than update the GCE packages. – Faizan Sep 12 '17 at 20:17
  • Were you able to solve this issue? If so please consider posting an answer, it would benefit the community. As per Faizan comment this could be related to new key format not being accepted by old guest enviroments as described here – Carlos Dec 7 '17 at 18:40
  • @Faizan Yes Accounts Script is working OK [0m] Started LSB: MD monitoring daemon. [[0;32m OK [0m] Started Authenticate and Authorize Users to Run Privileged Tasks. [[0;32m OK [0m] Started Accounts Service. [[0;32m OK [0m] Started Login to default iSCSI targets. Steps you asked me to follow It's throws me error source list tee. I am running Ubuntu 16.04 and python 2.7. I no expert in this – twister_void Sep 23 '18 at 8:47
1

Finally, this resolved my problem: I am able to log in from the browser and new keys

If you're seeing this on Debian 8 or 9, the most likely reason for this is that the google-compute-engine.* packages that allow SSH access to the instance has been removed by apt-get autoremove.

If you have an open SSH connection to the machine or can use a tool like gcloud, running apt-get update && sudo apt-get install gce-compute-image-packages should fix this.

If you no longer have any SSH access, there is a procedure available on the GCP docs site that can be used to restore it.

For more : https://stackoverflow.com/a/48257469/637377.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.