Can't use sudo and couldn't access root user to fix it after running chmod -R 777 /usr/ [duplicate]











up vote
0
down vote

favorite













This question already has an answer here:




  • Set myself as owner of /etc with chown command now getting all kinds of errors [duplicate]

    2 answers



  • What if I accidentally run command “chmod -R” on system directories (/, /etc, …)

    7 answers




I used these commands to allow access to git clone katoolin to be stored in usr



sudo chmod -R 777 /usr/
sudo chown www-data:www-data /usr/


I don't know which one ruined my sudo access. Also, I don't have access to root. I tried entering into recovery mode then into root shell and used commands from /usr/bin/sudo must be owned by uid 0 and have the setuid bit set but it didn't work.



Kind of new to it. Some help would be helpful.










share|improve this question















marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna Nov 30 at 16:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Proper way to install Katoolin: askubuntu.com/questions/772495/…
    – karel
    Nov 28 at 6:03















up vote
0
down vote

favorite













This question already has an answer here:




  • Set myself as owner of /etc with chown command now getting all kinds of errors [duplicate]

    2 answers



  • What if I accidentally run command “chmod -R” on system directories (/, /etc, …)

    7 answers




I used these commands to allow access to git clone katoolin to be stored in usr



sudo chmod -R 777 /usr/
sudo chown www-data:www-data /usr/


I don't know which one ruined my sudo access. Also, I don't have access to root. I tried entering into recovery mode then into root shell and used commands from /usr/bin/sudo must be owned by uid 0 and have the setuid bit set but it didn't work.



Kind of new to it. Some help would be helpful.










share|improve this question















marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna Nov 30 at 16:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Proper way to install Katoolin: askubuntu.com/questions/772495/…
    – karel
    Nov 28 at 6:03













up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:




  • Set myself as owner of /etc with chown command now getting all kinds of errors [duplicate]

    2 answers



  • What if I accidentally run command “chmod -R” on system directories (/, /etc, …)

    7 answers




I used these commands to allow access to git clone katoolin to be stored in usr



sudo chmod -R 777 /usr/
sudo chown www-data:www-data /usr/


I don't know which one ruined my sudo access. Also, I don't have access to root. I tried entering into recovery mode then into root shell and used commands from /usr/bin/sudo must be owned by uid 0 and have the setuid bit set but it didn't work.



Kind of new to it. Some help would be helpful.










share|improve this question
















This question already has an answer here:




  • Set myself as owner of /etc with chown command now getting all kinds of errors [duplicate]

    2 answers



  • What if I accidentally run command “chmod -R” on system directories (/, /etc, …)

    7 answers




I used these commands to allow access to git clone katoolin to be stored in usr



sudo chmod -R 777 /usr/
sudo chown www-data:www-data /usr/


I don't know which one ruined my sudo access. Also, I don't have access to root. I tried entering into recovery mode then into root shell and used commands from /usr/bin/sudo must be owned by uid 0 and have the setuid bit set but it didn't work.



Kind of new to it. Some help would be helpful.





This question already has an answer here:




  • Set myself as owner of /etc with chown command now getting all kinds of errors [duplicate]

    2 answers



  • What if I accidentally run command “chmod -R” on system directories (/, /etc, …)

    7 answers








16.04 permissions sudo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 30 at 16:40









Zanna

49.3k13127236




49.3k13127236










asked Nov 28 at 4:47









Kunal Goyal

1




1




marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna Nov 30 at 16:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna Nov 30 at 16:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Proper way to install Katoolin: askubuntu.com/questions/772495/…
    – karel
    Nov 28 at 6:03


















  • Proper way to install Katoolin: askubuntu.com/questions/772495/…
    – karel
    Nov 28 at 6:03
















Proper way to install Katoolin: askubuntu.com/questions/772495/…
– karel
Nov 28 at 6:03




Proper way to install Katoolin: askubuntu.com/questions/772495/…
– karel
Nov 28 at 6:03










1 Answer
1






active

oldest

votes

















up vote
2
down vote













sudo chmod -R 777 /usr;sudo chown www-data:www-data /usr/ broke your system irretrievably. There are two methods of recovering from such an error. First, and by far the easiest, is to reinstall Ubuntu. The second is to find the correct ownerships and permissions of each of the approximately 542,574 files and directories in /usr, and change each file or directory to the correct value for each one.






share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    sudo chmod -R 777 /usr;sudo chown www-data:www-data /usr/ broke your system irretrievably. There are two methods of recovering from such an error. First, and by far the easiest, is to reinstall Ubuntu. The second is to find the correct ownerships and permissions of each of the approximately 542,574 files and directories in /usr, and change each file or directory to the correct value for each one.






    share|improve this answer

























      up vote
      2
      down vote













      sudo chmod -R 777 /usr;sudo chown www-data:www-data /usr/ broke your system irretrievably. There are two methods of recovering from such an error. First, and by far the easiest, is to reinstall Ubuntu. The second is to find the correct ownerships and permissions of each of the approximately 542,574 files and directories in /usr, and change each file or directory to the correct value for each one.






      share|improve this answer























        up vote
        2
        down vote










        up vote
        2
        down vote









        sudo chmod -R 777 /usr;sudo chown www-data:www-data /usr/ broke your system irretrievably. There are two methods of recovering from such an error. First, and by far the easiest, is to reinstall Ubuntu. The second is to find the correct ownerships and permissions of each of the approximately 542,574 files and directories in /usr, and change each file or directory to the correct value for each one.






        share|improve this answer












        sudo chmod -R 777 /usr;sudo chown www-data:www-data /usr/ broke your system irretrievably. There are two methods of recovering from such an error. First, and by far the easiest, is to reinstall Ubuntu. The second is to find the correct ownerships and permissions of each of the approximately 542,574 files and directories in /usr, and change each file or directory to the correct value for each one.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 28 at 6:00









        waltinator

        21.8k74169




        21.8k74169















            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?