3

I executed sudo chmod -rwx /

To my surprise, all the icons on the dock vanished and all the commands (from man to sudo) are now unrecognised or not found.

The system had only one user.

We shut down the system and tried to login via tty2. The screen runs on a loop.

We are not able to see the normal login screen when We tried boot it up either.

Is there anything that we could do?

Zanna
  • 70,465

1 Answers1

3

You'll have to boot a Live System, mount your system drive and fix it from there.

Step 1: Find an Live medium (USB stick or DVD) you can insert in your system.

Step 2: Boot your system from the Live medium.

Step 3: Open a terminal

Step 4: Find the device name of your damaged root file system (for example using sudo fdisk -l), for example /dev/sda1.

Step 5: Mount the damaged root file system on /mnt with the command

sudo mount /dev/sda1 /mnt

Step 6: Fix the damage with the command

sudo chmod 755 /mnt

Step 7: Unmount the file system again with

sudo umount /mnt

Step 8: Reboot back into your installation

Zanna
  • 70,465
Tilman
  • 3,599
  • 21
  • 27
  • Could you elaborate a bit more, if you don't mind ? – cantaloupeMan Apr 19 '17 at 11:26
  • Yes it will. chmod on a mount point affects the root directory of the filesystem mounted at that point. – Tilman Apr 19 '17 at 11:31
  • already did that – Tilman Apr 19 '17 at 11:40
  • Error : Sudo must be owned by Uid 0 and have setuid bit set – cantaloupeMan Apr 19 '17 at 11:47
  • What did you use as Live System? It seems that sudois damaged on that medium. – Tilman Apr 19 '17 at 11:50
  • Alternatively, become root and use the commands without sudo as I wrote originally before Zanna edited them. – Tilman Apr 19 '17 at 11:51
  • The system on which I performed Chmod has ubuntu 16 . The live medium I used (USB stick) has 14. Will this affect it .. – cantaloupeMan Apr 19 '17 at 11:53
  • No, on both accounts: 1) The sudo command of your live medium will not be affected by the system on your hard disk, so the error you reported cannot be caused by the version difference. 2) mount and chmod are not Ubuntu release specific, so the commands of a working Ubuntu 14 live medium will work fine on your Ubuntu 16 disk. – Tilman Apr 19 '17 at 13:01
  • How does one become root on a live Ubuntu system without using sudo -i or some other variant? There's no root account. You could maybe use recovery mode and start a root shell and remount the filesystem rw instead of using a live boot, idk. @V.AdithyaGanesan Tilman is right, your live system is broken - get a new one (make it on a friend's computer maybe). You should not be getting that error doing it this way. – Zanna Apr 19 '17 at 16:27