$HOME/.ssh/authorized_keys and sure enough the only one in there was the old one.
After trying to connect through SSH in my browser from GCE console (unsuccessfully as well) I check out the help at https://cloud.google.com/compute/docs/ssh-in-browser#ssherror.
After reading through that I checked my serial port logs and couldn't find accounts-from-metadata: anywhere, so I'm pretty sure my Google Daemon is not starting up (which would explain why my instance never updates the metadata/ssh keys). I reset it again for good measure, but am still having the same issue.
Is there a way I can manually start up/repair the Google Daemon?
Thanks!
google-network-setup.service
Started Google Compute Engine IP Forwarding Daemon
Started Google Compute Engine Startup Scripts
google-ip-forwarding-daemon.service enabledStarted Google Compute Engine Startup Scripts
Why are these scripts/services not starting/running? I'm suspicious they are the reason (or caused by the same thing) that I cannot SFTP to the VM.
Thanks
In Ubuntu 16.04 LTS both “Google Compute Engine Network Setup” ( seems only on RHEL and CentOS), and “Google Compute Engine IP Forwarding Daemon” are not part of the guest environment. However, “Google Compute Engine Network Daemon” is. You may verify all enabled services by running the following command:
$ sudo systemctl list-unit-files \
> | grep google | grep enabled
google-accounts-daemon.service enabled
google-clock-skew-daemon.service enabled
google-instance-setup.service enabled
google-network-daemon.service enabled
google-shutdown-scripts.service enabled
google-startup-scripts.service enabled
As for the startup script service, it does not keep a running a process in the background after booting up. The script’s sole purpose is to run startup scripts attached to the metadata when booting up, and not related to SSH. Hence, if it is missing in the list above, you could try enabling it as to automatically start on boot-up :
sudo systemctl enable google-startup-scripts.service Furthermore, if you have a startup script that needs to run immediately you can use:
sudo systemctl start google-startup-scripts.serviceOn the other hand, to check for processes needed to SSH, you may verify if “network daemon” and “accounts daemon” are running:
sudo ps aux | grep googleThat said, and from your description (after reinstalling the environment), and assuming you are able to SSH from console or using gcloud commands, the managed key pair are being propagated which indicates that the guest environment is working fine.
Getting back to your current issue, I suggest first eliminating the possibility of having a local issue (SFTP client or your computer’s firewall, etc.) by testing your SFTP client with a different or new instance (e.g f1-micro).
If that is not the case, you may try (with the existing instance) recreating the key pair for a new user, making sure that the same user with the public key are attached to the metadata (project level or instance level). Then, and before using an SFTP client, verify through a third party SSH client (e.g putty) that you are able to SSH using the private key. If that fails, and for further help, please open a private issue tracker, including your project ID, instance name, and all SSH verbosity logs.