Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Location
    Florida
    Posts
    1,930

    Question Find all directories with 0777 permission.

    Hello, due to a major bug found in some software installed on our server I would like to scan for all directories set with 0777 permissions. Is there a bash script or command I can run to get a list or possibly even chmod the directories to something else?

    EDIT: Nevermind, I figured it out.
    Last edited by ZKuJoe; 06-14-2009 at 10:30 AM.
    -Joe @ Secure Dragon LLC.
    + OpenVZ Powered by Wyvern | KVM | cPanel Hosting | Backup VPSs | LowEndBoxes | DDOS Protection
    + Florida | Colorado | Illinois | California | Oregon | Georgia | New Jersey | Arizona | Texas

  2. #2
    Join Date
    Jun 2009
    Location
    Kochi,India
    Posts
    177
    You can use find command for this
    If you want to see if you have any directories with world write permission, use:
    # find . -type d -perm 777 -print
    If you want to find and change the permissions here is the command for it
    # find . -type d -perm 777 | xargs chmod 755
    Last edited by Rekhatitus; 06-14-2009 at 10:41 AM. Reason: correction
    Ezeelogin -
    The ultimate multiple server administration software.
    *Parallel shell *rm -rf protection *SSH logging*automated password changes*encrypted storage*
    AdMod.com -Delivering innovative web hosting solutions

  3. #3
    You can also replace the . if you want to search all files in a particular path

    find /home/*/public_html -type d -perm 777 -print

    although you may want to pipe that to a file as it could make a long list..
    cPanel Hosting
    Site5.com - Best support in the hosting business!

  4. #4
    In both examples folks suggested . - from the current dir and /home/* under the home.
    You may definitely want to do search on root / .

  5. #5
    Join Date
    Feb 2007
    Location
    Florida
    Posts
    1,930
    I actually found out that only public_html was affected so a simple chmod 0750 */public_html worked.
    -Joe @ Secure Dragon LLC.
    + OpenVZ Powered by Wyvern | KVM | cPanel Hosting | Backup VPSs | LowEndBoxes | DDOS Protection
    + Florida | Colorado | Illinois | California | Oregon | Georgia | New Jersey | Arizona | Texas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •