I accidentally did chmod -777 / now I can't access anything, when I restart a dialog is shown saying "your graphics is set to low", after giving ok, then there is an option " exit to login screen" when I select this I get a blank screen with "-" on top.

Is there any way to revert this process or at least to recover the data ?

P.S: I m using windows vista and Ubuntu 13.04 (dual boot).

| improve this question | | | | |
  • Did you use sudo chmod -R 777 / or sudo chmod 777 / ? – TuKsn May 24 '14 at 17:51
  • Where did you get advice to use chmod with 777 ? – Mateo May 24 '14 at 19:11
  • 1
    might be related: askubuntu.com/questions/43621/… – Mateo May 24 '14 at 19:16
  • 1
    I did chmod -777 / – YasirAzzu May 25 '14 at 3:41
  • 2
    chmod -777 is like chmod 000... Although it is not in the manual. Bug or hidden feature? – Rmano May 25 '14 at 5:22

Note that chmod -777 is like chmod 000. So the OP has probably just changed the permissions of the / folder, not recursively, and he or she can recover the system simply with a

chmod 755 /

from a recovery boot. For example, boot from the installation media, choose try Ubuntu, open a terminal and go superuser (do the following checking thrice and only after having understood what you are doing)

sudo -i
mount /dev/yourrootpartitonhere /mnt
cd /mnt
chmod 755 .
cd ..
umount /mnt

And reboot normally, all should be OK.

If you did use -R, do a backup of your data (see other answers here), and reinstall.

| improve this answer | | | | |
  • Hi Rmano, thanks for you answer I followed your instructions but it didn't work – YasirAzzu May 25 '14 at 8:55
  • I did every thing Rmano said I didn't get any error ( except after ' chmod 755 .' I did ' cd .. ' to come out of mnt ), nothing changed I m getting the same dialog box after reboot – YasirAzzu May 25 '14 at 16:46
  • Are you sure you mounted your correct root partition? – Rmano May 25 '14 at 20:05
  • Yes I did correctly, I mounted the ' / ' partition – YasirAzzu May 26 '14 at 17:07
  • 1
    If you booted from recovery media, the '/' partition is not the partition you want, but rather the root of the recovery media. You have to find your HD, and find the root of your actual HD, rather than your recovery root. – daviewales May 28 '14 at 11:49

Thanks for your answers.

I freshly installed Ubuntu 14.04, however I was able to backup my data using live CD.

I booted from a live CD and I did chmod 777 / 'pathOfTheDirectory'

Do not mess with things in which you don't have much knowledge - lesson learned.

| improve this answer | | | | |

If you ran the command chmod -777 /foo, it could have some weird functionality. Most likely, it will negate the bits you are passing in the octal negation of 777 (which is 111111111 in binary, which is important), which is not actually possible to represent, since chmod is using a 9 bit set for file permissions (1 bit per permission for read, write, execute * owner,group,user), which is an unsigned number (cannot be negative).

Let's assume that you can represent signed numbers (negative and positive values). If you find 2's complement of 777 (0b111111111), then you can figure out the exact behavior of (and number you are passing to) the command:

1000000000 #this number will cause an overflow because it is 512
           #since our range is only -256 -> 255

What does all this mean? You told the kernel "Hey, make the permissions for this folder 1000000000". The kernel responded with "Ok" and did what you asked. Now your filesystem permissions are exactly that, --------- root root /. This is all assuming that I (and your kernel/CPU) did the math correctly.


The root filesystem's (what / is) default permissions are usually 755. The easiest way to fix this is to log in and switch to tty using Ctrl+F1 (which will take you to tty1, tty2-6 are open as well, with tty7 being the location of the current X session). You can log in as root (or as a regular user, but use sudo before each command below) and run this command:

chmod 755 /

That should fix the issue you are having.

| improve this answer | | | | |
  • Hi ChrisR, thanks for your answer. When run sudo chmod 755 / I get "sudo: effective uid is not 0, is sudo installed setuid root?" When I tried without sudo I got "chmod: changing permission s of '/': operation not allowed". – YasirAzzu May 25 '14 at 9:04
  • If you know root's password, you can just su, enter the root password, and run the command as root. – ChrisR. May 25 '14 at 18:49
  • 2
    You can't use sudo until you fix your / permissions... so the need to do that from a recovery environment. – Rmano May 25 '14 at 20:09
  • @ChrisR I don't know root password, is there something like default password – YasirAzzu May 26 '14 at 17:05
  • If you never set it up, and your system is in it's current state, you have one of two options: 1) load the Ubuntu Live CD or 2) Install from scratch. – ChrisR. May 26 '14 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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