1

By mistake I entered the command

sudo chmod -R 777 somefolder ./ 

Now I am unable to log in to my system as root user. I have the login loop problem

Zanna
  • 69,223
  • 56
  • 216
  • 327
sai charan
  • 11
  • 1
  • 2
  • 2
    Why would you want to log in as root? What directory were you in when you ran the command? If you have the error in your title, I guess you must have run it at least on `/usr` if not on `/`. Fixing *recursive* `chmod` is a pain... If you want the least hassle, get your data off there with a live USB and reinstall – Zanna Aug 11 '17 at 07:18
  • 3
    Possible duplicate of [What if I accidentally run command "chmod -R" on system directories (/, /etc, ...)](https://askubuntu.com/questions/43621/what-if-i-accidentally-run-command-chmod-r-on-system-directories-etc) – muru May 16 '18 at 07:25

1 Answers1

2

Hi i had a similar problem and this is how i solved it.

  • First reboot your machine and enter the recovery mode from your grub menu
  • Choose the drop to root shell option.This will prompt you with a control-D to continue just press enter
  • You are now in a root shell.Do the following

    mount -o remount,rw /
    chown root:root /usr/bin/sudo
    chmod 4755 /usr/bin/sudo
    exit

  • Go back to the menu and choose resume normal boot

basebandit
  • 21
  • 4