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.

restoring home directories permissions.

Discussion in 'General Discussion' started by vishal, Dec 28, 2003.

  1. vishal

    vishal Well-Known Member

    Joined:
    Jan 28, 2003
    Messages:
    340
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Hello All,

    All the permissions of directories in /home partition are chmod to 711, owner and group as root. How can I fix the owner, group and permissions according to the user. Please help.

    Thank you,
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    711 is correct just the ownership needs to be corrected. You can do this running the following commands in shell as root;

    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
     
  3. vishal

    vishal Well-Known Member

    Joined:
    Jan 28, 2003
    Messages:
    340
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Thank you very much. That help me out.
     
  4. dianaward

    dianaward Well-Known Member

    Joined:
    Dec 9, 2002
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Twitter:
    Helped me too, since I just moved 2 servers full of sites

    to new servers via WHM and the permissions were a MESS. Thanks. I want to be you when I grow up.
     
  5. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider

    The sex change may not be worth the hassle. :D
     
  6. kalitebil

    kalitebil Member

    Joined:
    Jun 30, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    malatya/turkey
    Must we write like this?
    do chown -R $CPAccess:$CPAccess /home/$CPAccess
     
  7. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Use the commands exactly as they are written.
     
  8. kalitebil

    kalitebil Member

    Joined:
    Jun 30, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    malatya/turkey
    ide0(3,3): warning, user block quota exceeded
    --
    it is giving this error.
     
  9. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    ?? Are you logged in as root??

    If logged in as root, try logging out and back in.
     
  10. sv1

    sv1 Well-Known Member

    Joined:
    Aug 31, 2003
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    I get :
    -bash: syntax error near unexpected token `do'
     
  11. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    What was the command you typed? They MUST be EXACTLY as shown below.

    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
    
     
  12. sv1

    sv1 Well-Known Member

    Joined:
    Aug 31, 2003
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    This has corrected the errors. Thank you for your help :)
     
  13. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    david... for those of us with just enough knowledge to be dangerous, would you have the patience to explain those command? I do understand the basics in each string, but I'm not sure about the structure of each complete command line... maybe I'll guess...

    for CPAccess in `ls -A /var/cpanel/users`;
    ... is this part starting a foreach type loop and assigning the var name CPAccess to represent the name of each user in /var/cpanel/users ?

    do chown -R $CPAccess:$CPAccess /home/$CPAccess;
    ... and then this part is chowning each corresponding user dir it finds

    done
    ... and then this part closes the foreach looping when it runs out of matches?

    cool :)
     
  14. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Aces!! Dead on. That's exactly what is does. :D
     
  15. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    By George, I think I'm getting it!

    That's pretty elegant. :)
     
  16. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    I don't think I'm quite to the point of being dangerous yet. I'm too scared to do anything except the most rudimentary tasks.

    But I'm learning an amazing amount of new stuff here at this forum. And I like it 10 times better than webhostingtalk.com Much more cozy and less intimidating here. And I'm treated with respect, not like the idiot newbie I am. :D
     
Loading...

Share This Page