-2

I didn't check that I'm at root and I ran

chown www-data:www-data -R *
find . -type d -exec chmod 755 {} \;  
find . -type f -exec chmod 644 {} \; 

I don't have backup thats why I cant restore

all my website's goes 503 :(

The last thing that I saw on command was http://prntscr.com/oags7v before I scream

How can I recover the original ownership of the files and their permissions with chown and chmod?

thank you in advance & best regards...

Codekie
  • 7,574
  • 3
  • 18
  • 26
MoriEdan
  • 1
  • 3

1 Answers1

0

At this point... first read The Tao of Backup. Better late than never.

Then, back up anything yours. Any apps you made, any data you have. Anything that is not OS.

Wipe the machine clean, reinstall OS. Reinstall any necessary software.

Put your data back, and chown them appropriately.

Make sure everything works.

Then see if you learned anything from The Tao of Backup. Reread as needed.

Amadan
  • 191,408
  • 23
  • 240
  • 301
  • **Thank you** I'm so late for backup working data, I already started to download everything but OS... I juz wanna learn if I didn't activated backup option of digitalocean can anyone (from DigitalOcean) rollback? – MoriEdan Jul 04 '19 at 10:58
  • There _may_ be a chance though as you're on Centos - try `rpm --setugids -a` recommended by [How to revert chown command?](https://unix.stackexchange.com/questions/48845/how-to-revert-chown-command). No promises though. Still do read The Tao of Backup. You don't need to purchase the backup option, even a home-brewed backup is better than no backup. – Amadan Jul 04 '19 at 11:03