0

On the Google Cloud I made a mistake on my instance: chmod 777 -r . on my home folder.

Now I cannot login into my account: I have tried to recreate the ssh key but it did not help.

Any suggestions would be appreciated.

Thank you.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
  • 2
    For some background: [Why is `chmod -R 777` destructive?](https://serverfault.com/q/364677/37681) -I'm not very familiar with Google Cloud but maybe my google-fu is slightly better because I found this: https://cloud.google.com/compute/docs/instances/interacting-with-serial-console which should grant you access and allow you to restore sane permissions on your `~/.ssh/*` directories and files, after which you should be able to log on normally again with SSH (The SSH daemon refuses to allow key based logins when the permissions on the keys files are insecure.) – HBruijn Jun 24 '17 at 15:32
  • As @HBruijn is pointing, wrong permission on ssh keys won't allow you to connect. Set: the .ssh directory permissions to 700 (drwx------) , the public key (.pub file) to 644 (-rw-r--r--) and, if you have, private keys (id_rsa) to 600 (-rw-------). – Federico Galli Jun 26 '17 at 16:08
  • I was able to reconnect. This may not apply to a general setup, but for Google Cloud one can create a new owner account using a separate email address; an owner account allows logging in as root as changing the permissions appropriately. – Alin Tomoiaga Jun 27 '17 at 19:17

1 Answers1

0

I was able to reconnect. This may not apply to a general setup, but for Google Cloud one can create a new owner account using a separate email address; an owner account allows logging in as root as changing the permissions appropriately.