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?


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.
| improve this answer | |
  • Yes, I learn from my mistakes, and that's a good thing. – Typewar Apr 22 '17 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.