I only wanted to change the permissions of a folder which contains a lot of other folders and files, but ended up changing everything from root ( / ).

I searched for "change permissions of all files and subdirectories linux" and ended up finding this: How to set chmod for a folder and all of its subfolders and files in Linux Ubuntu Terminal? [closed]. I used the code which had the top upvotes, except that I removed the path because I thought I didn't need it because I was already in the folder I wanted to change. What I didn't think through, was the little forward slash I put in there, so everything changed to 777

find / -type d -exec chmod 777 {} \;

Now I can't access it with ssh or sftp. What should I do to change the permissions back again?


1 Answer 1


If I've understood correctly, there is no old value of file permissions stored anywhere in the system, hence Joe's answer-as-a-comment that one must

  • restore from backup, or
  • reinstall.
  • Yes, I learn from my mistakes, and that's a good thing.
    – Typewar
    Apr 22, 2017 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .