What to do when you remove permission for all users with chmod?












4















I am using Debian 8 stretch and I typed the command:



chmod  a-wx * 


Then my desktop turns black and I cannot reboot back to the OS.










share|improve this question

























  • Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?

    – Xen2050
    Jan 3 at 0:59











  • Yes I think I ran it in the folder containing home

    – scholar guy
    Jan 3 at 5:18











  • That's a lot easier to fix then, I'll try an answer

    – Xen2050
    Jan 3 at 6:30











  • Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux

    – Mawg
    Jan 3 at 7:23
















4















I am using Debian 8 stretch and I typed the command:



chmod  a-wx * 


Then my desktop turns black and I cannot reboot back to the OS.










share|improve this question

























  • Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?

    – Xen2050
    Jan 3 at 0:59











  • Yes I think I ran it in the folder containing home

    – scholar guy
    Jan 3 at 5:18











  • That's a lot easier to fix then, I'll try an answer

    – Xen2050
    Jan 3 at 6:30











  • Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux

    – Mawg
    Jan 3 at 7:23














4












4








4








I am using Debian 8 stretch and I typed the command:



chmod  a-wx * 


Then my desktop turns black and I cannot reboot back to the OS.










share|improve this question
















I am using Debian 8 stretch and I typed the command:



chmod  a-wx * 


Then my desktop turns black and I cannot reboot back to the OS.







debian chmod






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 5 at 19:47









GAD3R

2,4341226




2,4341226










asked Jan 2 at 14:32









scholar guyscholar guy

233




233













  • Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?

    – Xen2050
    Jan 3 at 0:59











  • Yes I think I ran it in the folder containing home

    – scholar guy
    Jan 3 at 5:18











  • That's a lot easier to fix then, I'll try an answer

    – Xen2050
    Jan 3 at 6:30











  • Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux

    – Mawg
    Jan 3 at 7:23



















  • Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?

    – Xen2050
    Jan 3 at 0:59











  • Yes I think I ran it in the folder containing home

    – scholar guy
    Jan 3 at 5:18











  • That's a lot easier to fix then, I'll try an answer

    – Xen2050
    Jan 3 at 6:30











  • Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux

    – Mawg
    Jan 3 at 7:23

















Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?

– Xen2050
Jan 3 at 0:59





Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?

– Xen2050
Jan 3 at 0:59













Yes I think I ran it in the folder containing home

– scholar guy
Jan 3 at 5:18





Yes I think I ran it in the folder containing home

– scholar guy
Jan 3 at 5:18













That's a lot easier to fix then, I'll try an answer

– Xen2050
Jan 3 at 6:30





That's a lot easier to fix then, I'll try an answer

– Xen2050
Jan 3 at 6:30













Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux

– Mawg
Jan 3 at 7:23





Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux

– Mawg
Jan 3 at 7:23










3 Answers
3






active

oldest

votes


















3














Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd into the directories anymore which is probably causing problems.





You should be able to add those permissions back, and there's a few options to do that:




  • If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (rw).



  • Or, you can try booting your main install in Single-user mode:




    DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)




    1. First screen - grub - press e

    2. Modify kernel line: add single between ro quiet and at the end of this line add init=/bin/bash

    3. Press F10

    4. When the prompt is root@(none):/# you have to remount the / partition to have read-write access:
      mount / -rw -o remount





Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd to your user's home folder and just run a "reverse":



    chmod -v a+wx *


That should add back write permissions & let you cd into directories again, and hopefully boot OK.



It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like



    find [home folder] -maxdepth 1 -type f  ! -name ".*" -print0 | xargs -0 chmod -v a-x




Another option is to just replace everything in your home with "defaults" from /etc/skel then the next boot should be like the very first boot.





Or yet another option would be to just create a new user (while booted in single-user mode) using adduser, and forget about or delete the whole old user (with deluser)






share|improve this answer
























  • Thanks for the help

    – scholar guy
    Jan 3 at 7:10











  • Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]

    – Xen2050
    Jan 3 at 7:19



















1














Ctrl-alt and f1-f6 should work to get you into any other vtty.



From there your permissions can be restored by the root user.






share|improve this answer































    0














    I don't think it's possible, you may have to just salvage your files and re-install.



    However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.



    And I would like to say my congratulations for bricking your system. That was quite a move.






    share|improve this answer
























    • Well fortunately I have nothing important in the OS as it happened the first day I download Debian

      – scholar guy
      Jan 3 at 5:20











    • In that case I would just reinstall to save you all the hassle.

      – TheChubbyPanda
      Jan 3 at 8:58











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1389801%2fwhat-to-do-when-you-remove-permission-for-all-users-with-chmod%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd into the directories anymore which is probably causing problems.





    You should be able to add those permissions back, and there's a few options to do that:




    • If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (rw).



    • Or, you can try booting your main install in Single-user mode:




      DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)




      1. First screen - grub - press e

      2. Modify kernel line: add single between ro quiet and at the end of this line add init=/bin/bash

      3. Press F10

      4. When the prompt is root@(none):/# you have to remount the / partition to have read-write access:
        mount / -rw -o remount





    Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd to your user's home folder and just run a "reverse":



        chmod -v a+wx *


    That should add back write permissions & let you cd into directories again, and hopefully boot OK.



    It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like



        find [home folder] -maxdepth 1 -type f  ! -name ".*" -print0 | xargs -0 chmod -v a-x




    Another option is to just replace everything in your home with "defaults" from /etc/skel then the next boot should be like the very first boot.





    Or yet another option would be to just create a new user (while booted in single-user mode) using adduser, and forget about or delete the whole old user (with deluser)






    share|improve this answer
























    • Thanks for the help

      – scholar guy
      Jan 3 at 7:10











    • Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]

      – Xen2050
      Jan 3 at 7:19
















    3














    Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd into the directories anymore which is probably causing problems.





    You should be able to add those permissions back, and there's a few options to do that:




    • If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (rw).



    • Or, you can try booting your main install in Single-user mode:




      DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)




      1. First screen - grub - press e

      2. Modify kernel line: add single between ro quiet and at the end of this line add init=/bin/bash

      3. Press F10

      4. When the prompt is root@(none):/# you have to remount the / partition to have read-write access:
        mount / -rw -o remount





    Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd to your user's home folder and just run a "reverse":



        chmod -v a+wx *


    That should add back write permissions & let you cd into directories again, and hopefully boot OK.



    It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like



        find [home folder] -maxdepth 1 -type f  ! -name ".*" -print0 | xargs -0 chmod -v a-x




    Another option is to just replace everything in your home with "defaults" from /etc/skel then the next boot should be like the very first boot.





    Or yet another option would be to just create a new user (while booted in single-user mode) using adduser, and forget about or delete the whole old user (with deluser)






    share|improve this answer
























    • Thanks for the help

      – scholar guy
      Jan 3 at 7:10











    • Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]

      – Xen2050
      Jan 3 at 7:19














    3












    3








    3







    Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd into the directories anymore which is probably causing problems.





    You should be able to add those permissions back, and there's a few options to do that:




    • If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (rw).



    • Or, you can try booting your main install in Single-user mode:




      DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)




      1. First screen - grub - press e

      2. Modify kernel line: add single between ro quiet and at the end of this line add init=/bin/bash

      3. Press F10

      4. When the prompt is root@(none):/# you have to remount the / partition to have read-write access:
        mount / -rw -o remount





    Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd to your user's home folder and just run a "reverse":



        chmod -v a+wx *


    That should add back write permissions & let you cd into directories again, and hopefully boot OK.



    It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like



        find [home folder] -maxdepth 1 -type f  ! -name ".*" -print0 | xargs -0 chmod -v a-x




    Another option is to just replace everything in your home with "defaults" from /etc/skel then the next boot should be like the very first boot.





    Or yet another option would be to just create a new user (while booted in single-user mode) using adduser, and forget about or delete the whole old user (with deluser)






    share|improve this answer













    Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd into the directories anymore which is probably causing problems.





    You should be able to add those permissions back, and there's a few options to do that:




    • If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (rw).



    • Or, you can try booting your main install in Single-user mode:




      DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)




      1. First screen - grub - press e

      2. Modify kernel line: add single between ro quiet and at the end of this line add init=/bin/bash

      3. Press F10

      4. When the prompt is root@(none):/# you have to remount the / partition to have read-write access:
        mount / -rw -o remount





    Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd to your user's home folder and just run a "reverse":



        chmod -v a+wx *


    That should add back write permissions & let you cd into directories again, and hopefully boot OK.



    It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like



        find [home folder] -maxdepth 1 -type f  ! -name ".*" -print0 | xargs -0 chmod -v a-x




    Another option is to just replace everything in your home with "defaults" from /etc/skel then the next boot should be like the very first boot.





    Or yet another option would be to just create a new user (while booted in single-user mode) using adduser, and forget about or delete the whole old user (with deluser)







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 3 at 7:01









    Xen2050Xen2050

    10.6k31536




    10.6k31536













    • Thanks for the help

      – scholar guy
      Jan 3 at 7:10











    • Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]

      – Xen2050
      Jan 3 at 7:19



















    • Thanks for the help

      – scholar guy
      Jan 3 at 7:10











    • Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]

      – Xen2050
      Jan 3 at 7:19

















    Thanks for the help

    – scholar guy
    Jan 3 at 7:10





    Thanks for the help

    – scholar guy
    Jan 3 at 7:10













    Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]

    – Xen2050
    Jan 3 at 7:19





    Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]

    – Xen2050
    Jan 3 at 7:19













    1














    Ctrl-alt and f1-f6 should work to get you into any other vtty.



    From there your permissions can be restored by the root user.






    share|improve this answer




























      1














      Ctrl-alt and f1-f6 should work to get you into any other vtty.



      From there your permissions can be restored by the root user.






      share|improve this answer


























        1












        1








        1







        Ctrl-alt and f1-f6 should work to get you into any other vtty.



        From there your permissions can be restored by the root user.






        share|improve this answer













        Ctrl-alt and f1-f6 should work to get you into any other vtty.



        From there your permissions can be restored by the root user.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 5 at 20:42









        Guy GastineauGuy Gastineau

        314




        314























            0














            I don't think it's possible, you may have to just salvage your files and re-install.



            However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.



            And I would like to say my congratulations for bricking your system. That was quite a move.






            share|improve this answer
























            • Well fortunately I have nothing important in the OS as it happened the first day I download Debian

              – scholar guy
              Jan 3 at 5:20











            • In that case I would just reinstall to save you all the hassle.

              – TheChubbyPanda
              Jan 3 at 8:58
















            0














            I don't think it's possible, you may have to just salvage your files and re-install.



            However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.



            And I would like to say my congratulations for bricking your system. That was quite a move.






            share|improve this answer
























            • Well fortunately I have nothing important in the OS as it happened the first day I download Debian

              – scholar guy
              Jan 3 at 5:20











            • In that case I would just reinstall to save you all the hassle.

              – TheChubbyPanda
              Jan 3 at 8:58














            0












            0








            0







            I don't think it's possible, you may have to just salvage your files and re-install.



            However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.



            And I would like to say my congratulations for bricking your system. That was quite a move.






            share|improve this answer













            I don't think it's possible, you may have to just salvage your files and re-install.



            However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.



            And I would like to say my congratulations for bricking your system. That was quite a move.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 2 at 16:19









            TheChubbyPandaTheChubbyPanda

            1939




            1939













            • Well fortunately I have nothing important in the OS as it happened the first day I download Debian

              – scholar guy
              Jan 3 at 5:20











            • In that case I would just reinstall to save you all the hassle.

              – TheChubbyPanda
              Jan 3 at 8:58



















            • Well fortunately I have nothing important in the OS as it happened the first day I download Debian

              – scholar guy
              Jan 3 at 5:20











            • In that case I would just reinstall to save you all the hassle.

              – TheChubbyPanda
              Jan 3 at 8:58

















            Well fortunately I have nothing important in the OS as it happened the first day I download Debian

            – scholar guy
            Jan 3 at 5:20





            Well fortunately I have nothing important in the OS as it happened the first day I download Debian

            – scholar guy
            Jan 3 at 5:20













            In that case I would just reinstall to save you all the hassle.

            – TheChubbyPanda
            Jan 3 at 8:58





            In that case I would just reinstall to save you all the hassle.

            – TheChubbyPanda
            Jan 3 at 8:58


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1389801%2fwhat-to-do-when-you-remove-permission-for-all-users-with-chmod%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Сан-Квентин

            Алькесар

            8-я гвардейская общевойсковая армия