Search code examples
google-cloud-platformserverpermissionsupdates

what to do if I change the permissions of my home directories to 777, and my google cloud server no longer gives me access


enter image description here

After changing the permissions, I don't get past this error


Solution

  • Most likely you changed the permission of the directory .ssh. This breaks SSH security. You should be able to create a startup script to change the directory /home/<username>/.ssh to 700.

    • Go to the Google Cloud Console

    • Go to Compute Engine -> VM instances

    • Stop the VM instance

    • Click the Edit button

    • Scroll down to the section Custom metadata

    • For the key enter startup-script

    • Enter the following for the value replacing <username> with your username:

      #! /bin/bash

      chmod 700 /home/<username>/.ssh

    • Restart the instance

    Another method is to use the VM serial console:

    Troubleshooting using the serial console