I am an Ubuntu newbie, and I accidentally typed chown www-data:www-data * -R.
After a while, I tried to restart, but my computer couldn't even start, saying:

# Your screen, graphics cards, and input device settings could not be detected correctly. 
# You will need to configure these yourself. 

the command I executed is like this:

cd /home
sudo chown www-data:www-data * -R  
sudo usermod -a -G www-data username

Is there any way I can get out of this mess? Thank you

  • That command shouldn't do anything besides complaining about missing parameters. What command did you actually execute? – David Foerster Oct 13 '13 at 13:16
  • @DavidFoerster sudo chown www-data:www-data * -R followd by sudo usermod -a -G www-data username – meshsol Oct 13 '13 at 13:55
  • Ok, can you edit that into your question? The working directory of that command is relevant too. – David Foerster Oct 13 '13 at 13:58
  • I updated the question @DavidFoerster – meshsol Oct 13 '13 at 14:01
  • 1
    Good. Do you remember the working directory when you run that command? – David Foerster Oct 13 '13 at 14:03

Try booting using advanced settings, and do a system restore...there is an option for that on the ubuntu bootloader menu


If you accidentally change the ownership of everything in /home and it contains only home directories named after their respective owners, then you can revert that change as root like this:

cd /home
chown root:root .
for f in *; do
  case "$f" in
    lost+found) owner=root:root;;
    *) owner="$f:";;
  chown -R "$owner" "$f"

There may be a few corner cases like configurational or temporary files of some subsystem like X.org or Pulse inside those directories, which should be owned by root or some system account, but they shouldn't be too much of a problem.

Not the answer you're looking for? Browse other questions tagged or ask your own question.