0

I'm very much new to ubuntu. Please help me to change my server settings.

I am trying to install wordpress. Accidentally I ran this command in root directory:

sudo chown -R demo:www-data *

Now all my directory ownership is changed to www-data. How can I change this back to default setting?

Please help

muru
  • 197,895
  • 55
  • 485
  • 740
Dee
  • 3
  • 1

1 Answers1

0

Hm. You might have to reinstall your OS :(. But first try switching to root with the command:

su

Then, from the root directory, run the command to give root ownership to everything:

cd /
chown -R root:root *

Then go to your user home directory and give ownership back to yourself with:

cd /home/username
chown -R username:username *

replacing username with your real username. Finally switch back to being your normal user:

su username
  • It's a bit more complicated than that. A lot of things won't work with this (IDK if you will even be able to log in). Following the directions here (as specified by @muru) can solve your problem. – AlwaysTalkingAboutMyDog Mar 30 '16 at 02:51
  • @Zzzach... You're probably right, but I'm certainly not going to try it and find out! Nevertheless I still think doing it this way could be worth a shot prior to reinstalling. – apostl3pol Mar 30 '16 at 02:54