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.

change owner of files

Discussion in 'General Discussion' started by bhanuprasad1981, Nov 30, 2011.

  1. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    one of my customer requested to restore his public_html/some folders as he mistakenly deleted them i tried to copy those files from a previous incremental backup but the problem after restore is ownership of files and folders they all belong to root instead of user how to fix this ?
     
  2. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    387
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Hello,

    Run the following command from SSH, as root.

    chown -R user:user <directory full path > - here user is the user name

    Make sure that, you will specify the correct path when you run above command. An incorrest path can cause seriuos issues!

    Thank you,
    Nibin.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Of note, the top level of /home/username/public_html needs to be username:nobody rather than username:username for the account. This means you should use this instead:

    Code:
    cd /home/username
    chown -R username:username public_html
    chown username:nobody public_html
     
Loading...

Share This Page