Advertisement
Guest User

Untitled

a guest
Sep 1st, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.48 KB | None | 0 0
  1. echo "All directories have exec bit for recursive reading"
  2. find . -type d  -exec chmod -c 755 {} \;
  3.  
  4. echo "Everything in root is read only"
  5. find . -maxdepth 1 -type f  -exec chmod -c 444 {} \;
  6.  
  7. echo "Files in data & pub writable by server, except for rcs files which are read-only"
  8. find data -name '*.txt' -type f -exec chmod -c 644 {} \;
  9. find pub -type f -exec chmod -c 644 {} \;
  10. find data pub -name '*,v' -type f -exec chmod -c 444 {} \;
  11.  
  12. echo "Everything in data is writable by server."
  13. find data -maxdepth 1 -type f  -exec chmod -c 644 {} \;
  14.  
  15. echo "bin and tools needs to be executable - with exceptions"
  16. find bin -type f -exec chmod -c 555 {} \;
  17. chmod -c 644 bin/LocalLib.cfg.txt bin/.htaccess.txt
  18. chmod -c 444 bin/setlib.cfg
  19. find tools -type f -exec chmod -c 555 {} \;
  20. chmod -c 444 tools/extender.pl
  21.  
  22. echo "Everything else is read only"
  23. find lib -type f -exec chmod -c 444 {} \;
  24. find locale -type f -exec chmod -c 444 {} \;
  25. find bin/logos -type f -exec chmod -c 444 {} \;
  26. find templates -type f -exec chmod -c 444 {} \;
  27.  
  28. echo "Working is server writable - with exceptions"
  29. find working -type f -exec chmod -c 644 {} \;
  30. find working/configure -type f -exec chmod -c 444 {} \;
  31. chmod -c 444 working/tmp/README working/README working/registration_approvals/README
  32. chmod -c 444 working/work_areas/README
  33.  
  34. echo "Restrict security related files should not be world readable."
  35. find . -name .htaccess -exec chmod 440 {} \;
  36. chmod -c 640 data/.htpasswd
  37. chmod -c 640 lib/LocalSite.cfg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement