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.

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:
    1
    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,475
    Likes Received:
    20
    Trophy Points:
    38
    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
     
Loading...

Share This Page