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









New contributor




Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna 2 days ago


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









New contributor




Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna 2 days ago


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









New contributor




Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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









New contributor




Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Zanna

49.1k13123234




49.1k13123234






New contributor




Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 28 at 4:47









Kunal Goyal

1




1




New contributor




Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Kunal Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna 2 days ago


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 2 days ago


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.7k74169




        21.7k74169















            Popular posts from this blog

            數位音樂下載

            When can things happen in Etherscan, such as the picture below?

            格利澤436b