The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hacked .. Help! ..

Discussion in 'General Discussion' started by bapline, May 10, 2007.

  1. bapline

    bapline Member

    Joined:
    Nov 16, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    All Directories and files in home changed to nobody as owner ... all pop3 mail account missing (probably ownership related)....

    We're going down in flames.. everything is back working but how do we restore ownership.. we have comple backups

    Is there a way for whm to restore ownership of all files??? ...
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    You can run this script to modify proper ownership but you would be out of luck for permissions. I would suggest restoring your backup set provided your server is now secure.

    #!/bin/bash
    cd /var/cpanel/users
    for user in *
    do
    chown -R $user.$user /home/$user/public_html/*
    done
     
  3. bapline

    bapline Member

    Joined:
    Nov 16, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    This script is for cpanel account ownership or ??? I can still see all the users and accounts in WHM but on the server root in the home directory itself, the dirs & files have all changed to ownership or nobody :eek:

    Just want to make sure we're talking about the right thing and verify before we start running scripts .... I'm a mess
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    That will change public_html files to proper ownership.

    So you verify that /home/user/etc

    is owned by nobody.nobody instead of mail.user 0750 ??

    you should restore backups and be done with it. You did say you have a backup set. Why mess around?

    good luck
     
Loading...

Share This Page