0

I messed up my system while trying to fix permission problems for setting up a LAMP local server.

I tried this solution: How to avoid using sudo when working in /var/www? without success.

Then I saw this solution: Permissions issue: how can Apache access files in my Home directory?

I understood that I had to change the permissions of my root directory (among others), so I executed: sudo chmod 710 /

I also changed the user group on / to www-data.

I also did these operations on /home.

I'm pretty sure one of those commands broke something, because it's the last commands I executed, and after that, my system showed strange/broken behavior:

  • Firefox stopped showing pages
  • Some icons got replaced by an red X icon (meaning "Icon not found" I guess)
  • Applications refused to launch (no reaction)

After rebooting:

  • I got a strange graphical message talking about not being able to mount something, asking me if I wanted to wait, and talking about /tmp (I forgot the message since I was in shock)
  • My system now boots in console, and when I login, it flashes unsignificant stuff* before re-asking me to login.

My important data is on Ubuntu One. I'd prefer not having to reinstall from scratch. Is there a way to regain access to my system?

Thanks a lot for your help.

**Looks like a terminal header with the name of the OS and other info. Doesn't seem important.*

1 Answers1

0

Doing sudo chmod 710 / you have made / mode rwx--x---. So now just root has the permission to read and traverse it, and the group www-data can traverse it, but not read it... which means that noone but root can read the files in the filesystems, and normally the root account is disabled in Ubuntu.

It is possible to reverse what you have done for sure. The only problem is that you have to remember/detect where your partitions where; if you have not this information, you can use gparted to see where you root and home partition are.

I will suppose here that the system was installed with the root partition in /dev/sda2, adapt this to your case. It is a bit more complex if you have a separate /home partition. A

Boot with a live USB or CD. Choose "Try the system" and then, from a terminal:

1) go to superuser mode: (normally I wouldn't advise doing this, but you'll have to do quite a lot of things and using sudo in this case doesn't help a lot).

sudo -i 

2) mount the real drive of your system (adapt with your root partition)

mkdir /myroot
mount /dev/sda2 /myroot

3) re-do the root directory permission/owner

chown root.root /myroot
chmod 755 /myroot

4) do the same for /home: (if /home is on another partition, mount it under /myroot/home)

chown root.root /myroot/home
chmod 755 /myroot/home

That should undo what you did --- I hope you didn't change permission recursively. Reboot and cross your fingers...

Rmano
  • 32,167