Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

ownership problems after restore

Discussion in 'General Discussion' started by persiasoft, Mar 10, 2006.

  1. persiasoft

    persiasoft Active Member

    Joined:
    Nov 15, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    151
    we have migrated to another server , after restoring accounts, all the ownerships and permissions were missed , like this :

    drwxrwx--- 6 32330 mail 4096 Nov 23 12:03 ./
    drwx--x--x 10 32330 342 4096 Mar 9 14:41 ../
    drwxrwxrwx 2 32330 342 4096 Mar 5 18:38 cur/
    -rwxrwxrwx 1 32330 mail 2070 Nov 23 12:03 inbox*
    drwxrwxrwx 4 32330 mail 4096 Sep 26 08:21 root.acc/
    drwxrwxrwx 2 32330 342 4096 Mar 5 18:37 new/
    drwxrwxrwx 2 32330 342 4096 Mar 5 18:37 tmp/

    how to chown all /home/users to their users ? 1600 accounts . . . its very difficault to run chown command for every user . . . cause 1600 accounts hosted on this server !
    is there any way to fix this problem ?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    22
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Modified version of code originally submitted by dgbaker:
    Code:
    for CPAccess in `ls -A /var/cpanel/users`; do chown -R $CPAccess:$CPAccess /home/$CPAccess; done
    for CPAccess in `ls -A /var/cpanel/users`; do chown -R $CPAccess:mail /home/$CPAccess/etc /home/$CPAccess/mail; done
    for CPAccess in `ls -A /var/cpanel/users`; do chown -R $CPAccess:nobody /home/$CPAccess/public_html; done
    
    Then , to be sure, run:

    /scripts/chownpublichtmls
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice