-2

If the folders and files permission all suddenly goes to 000 on a web sever, can it be brought back? I yes, please let me have the script that can be executed to bring the permission back.

I have a hosting account and I change 1 folder's(cur) permission in the .Mail directory and when I saved, all folders and files in the ("Home" directory and all sub folders) have their permission turned to 000 suddenly and I got confused.

Help!

ostana
  • 1
  • 2
  • I believe if you search the archives you'll find the answer to this question without having to ask it again. – mdpc May 23 '13 at 20:58
  • Might have been better asked in SuperUser or UNIX SE. – mdpc May 23 '13 at 20:59
  • Probably unix. Also, @ostana, there isn't such a script - the old permissions are gone, and the only thing you can do automatically is set them all the same, which is probably not what you want, but google chmod. – Falcon Momot May 23 '13 at 21:24
  • It's been asked on [Unix & Linux](http://unix.stackexchange.com/questions/61997/recovering-from-chmod-r-777-in-ubuntu) (probably multiple times), as well as Server Fault. The basic answer is "You're out of luck. Hope you have a backup." – voretaq7 May 24 '13 at 02:54

1 Answers1

-1
chmod 600(or whatever you want) -R directory

This will recursively set the permissions on the directory. No need for a script. :)

It is unlikely that permissions can be set to 000 as a consequence of changing permission for one directory.

Sudheer
  • 169
  • 2
  • 10
  • This does not "fix" or "recover" anything - it simply sets a slightly more sane value than `000`. There is no reason to believe that setting everything to `600` is any better than `000`... – voretaq7 May 24 '13 at 02:53