I modified the permission all of my files including etc files


I don't know what i am supposed to do. i made a huge mistake by running this command on lighsail ssh "sudo chown -R bitnami:daemon /" now my files have the wrong permissions and nothing is working.

I can not run sudo commands so i can not change the permissions back. ERROR: "sudo: /etc/sudo.conf is owned by uid 1000, should be 0 sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set"

I was hoping somehow i can download the wordpress files from my lightsail instance using potty but that doesn't seem to work throwing the following error: "Permission denied (publickey)" the only thing i can do is modify and create files.

I read this: https://repost.aws/knowledge-center/ec2-sudo-commands but I don't thnk i can follow the instuctions for lightsail.

Any help would be deeply appriciated.

3 Answers

I think your Lightsail instance is beyond saving :-( You need to chown the files and directories back to make the system have a chance of being usable, but as you've found there's no way of becoming root to do that.

Your best option here may be to snapshot your Lightsail instance, then create an EBS volume from the snapshot, and attach that volume to an EC2 instance. You could then at least recover the WordPress data. See the section Troubleshoot or recover data from a Lightsail snapshot with an Amazon EC2 instance in https://repost.aws/knowledge-center/lightsail-export-linux-instance-ec2

profile picture
answered 3 months ago
  • Am having a real hard time following the instructions. Can you plz provide a vedeo or something helpful. I am really lost and I need to save this.

  • Here is the video that accompanies that knowledge article https://m.youtube.com/watch?v=BIIKGjJk-Bw



You might want to check this document https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-create-an-instance-root-volume-snapshot.html, to create a snapshot for your root volume and create a disk from that snapshot and attach it to an instance. You might be able to access your wordpress data.

answered 3 months ago

Hi, I want to give an update on my situation. Lets start with the fact that i managed to download the files via ssh :) . I think i have everything i need (wordpress files plus database files). Now I have to make a new lightsail instance and upload the old files. Now i have some options.

Option number 1 is to delete the wordpress file and upload the old one. And do the same for the database. Idk if this will be effective but i can try it. Second option is to import the database to the phpmyadmin. And upload only the necessary files like wp-themes,wp-plugins and all that.

Let me know wich one of this sounds like a better idea.

Lastly i want to say that i have been waiting for amazon to give me access to 20 lightsail instances. Right now I only have access to 2 even though in the quota section of AWS it clearly says i have acces to 20. I do not want to remove the damaged one in case I need a file or something.

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions