0

I'll admit I'm not the most sysadmin savvy person; this is my first time working with google cloud and bitnami so I really do not know what I'm doing.

The problem: I wanted to set the permissions of a project folder to 755 for php related reasons (creating/editing files for accounts on my project) and I did not know that the .ssh folder for the disk was located in the same spot - /home/[myusername]/. I intended to modify /home/[myusername]/[project]/userdata/ but I think I did it two directories up and recursively. Since it's now configured incorrectly, none of my keys work anymore, and even after generating new ones with PuttyGen and setting that up in the Google Cloud instance manager, I still can't connect. I have no obvious way of getting back into the server and fixing the permissions.

The question: Is there some other way for me to access my instance's file system to set the folder's permissions correctly and/or reset ssh? And what permissions should that folder have? I can access the google cloud console but I have no idea where to look. I don't want to start over because I made the further stupid mistake of not saving the project's code onto my local machine or a git repository.

Instance type: Bitnami LAMP 7.4.20-8

loohhoo
  • 1
  • 1
  • Use the serial port to correct the permissions on `.ssh` and it contents. https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-using-serial-console – John Hanley Jul 03 '21 at 21:35
  • The permissions for the folder `.ssh` should be `700` read-write-execute for the owner only. The permissions for `.ssh/authorized_keys` should be `600` read-write for the owner only. The `chmod` command can explain how to make these settings. – John Hanley Jul 03 '21 at 21:38
  • @JohnHanley I followed the steps and I get 'permission denied'. I tried: ```gcloud compute --project "project-name" ssh --zone "us-east4-a" "instance-name"``` (with my details) - which didn't work at first, so I did it again with sudo - and it generated a key pair but still refused to connect. Couldn't get to the next step to set a password. – loohhoo Jul 03 '21 at 21:53
  • Update: I was typing the project "name" and not its actual ID into the console, I'm now in my server instance :') thank you so much – loohhoo Jul 03 '21 at 22:04
  • 2
    Post an answer with the steps you followed that recovered your system. This will help others in the future. – John Hanley Jul 03 '21 at 22:24

0 Answers0