I am starting to use GCP. I fixed a server (redhat), connected to it (using SSH, directly from GCP console) and deployed my application, everything worked well To try to fix something I played with the authorizations on some folder of my server. And stupidly changed the owner of VAR folder. result -> I can not anymore connect to my server! Meaning, I cannot reverse this change and fix it.

When I try (gcloud command, or directly from console) here is what I get from the log (which totally comfort me on my analysis of the bug) :

Oct 18 08:54:41 serverlinux systemd: Started Google Compute Engine Instance Setup. Oct 18 08:54:41 serverlinux systemd: Starting OpenSSH server daemon... Oct 18 08:54:41 serverlinux sshd: /var/empty/sshd must be owned by root and not group or world-writable. Oct 18 08:54:41 serverlinux systemd: sshd.service: main process exited, code=exited, status=255/n/a Oct 18 08:54:41 serverlinux systemd: Failed to start OpenSSH server daemon. Oct 18 08:54:41 serverlinux systemd: Unit sshd.service entered failed state. Oct 18 08:54:41 serverlinux systemd: sshd.service failed.

Question: Do I have another way to connect to my server, and then fix this bug? Or I need to delete everything, redo everything (and be more careful next time I am playing with authorizations :( )

  • Did you try rebooting you VM to see if it resolve the issue? I changed the permission of \var directory and I was able to reproduce the issue. However, after a reboot the default permission of the directory is automatically recovered. – Kamran Oct 22 '17 at 17:57

You can enable interactive access to the serial console of your VM and then troubleshoot the instance. For more information visit Interacting with the Serial Console article.

| improve this answer | |

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.